Commit 103f7a60 authored by Ghislain MARY's avatar Ghislain MARY

Do not include dependencies in the link interface when building a shared library.

parent 8c553940
...@@ -37,15 +37,21 @@ if(MSVC) ...@@ -37,15 +37,21 @@ if(MSVC)
endif() endif()
add_executable(linphonec ${LINPHONEC_SOURCE_FILES}) add_executable(linphonec ${LINPHONEC_SOURCE_FILES})
target_link_libraries(linphonec linphone) target_link_libraries(linphonec linphone ${BCTOOLBOX_LIBRARIES} ${ORTP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES})
if(INTL_FOUND)
target_link_libraries(linphonec ${INTL_LIBRARIES})
endif()
if(WIN32) if(WIN32)
add_executable(linphoned WIN32 ${LINPHONEC_SOURCE_FILES}) add_executable(linphoned WIN32 ${LINPHONEC_SOURCE_FILES})
target_link_libraries(linphoned linphone) target_link_libraries(linphoned linphone ${BCTOOLBOX_LIBRARIES} ${ORTP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES})
if(INTL_FOUND)
target_link_libraries(linphoned ${INTL_LIBRARIES})
endif()
endif() endif()
add_executable(linphonecsh ${LINPHONECSH_SOURCE_FILES}) add_executable(linphonecsh ${LINPHONECSH_SOURCE_FILES})
target_link_libraries(linphonecsh linphone) target_link_libraries(linphonecsh linphone ${ORTP_LIBRARIES})
set(INSTALL_TARGETS linphonec linphonecsh) set(INSTALL_TARGETS linphonec linphonecsh)
if(WIN32) if(WIN32)
......
...@@ -230,7 +230,7 @@ if(ENABLE_SHARED) ...@@ -230,7 +230,7 @@ if(ENABLE_SHARED)
set_target_properties(linphone PROPERTIES SOVERSION ${LINPHONE_SO_VERSION}) set_target_properties(linphone PROPERTIES SOVERSION ${LINPHONE_SO_VERSION})
endif() endif()
add_dependencies(linphone liblinphone-git-version) add_dependencies(linphone liblinphone-git-version)
target_link_libraries(linphone ${LIBS}) target_link_libraries(linphone PRIVATE ${LIBS})
if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set_target_properties(linphone PROPERTIES PREFIX "lib") set_target_properties(linphone PROPERTIES PREFIX "lib")
elseif(ANDROID) elseif(ANDROID)
......
...@@ -94,7 +94,7 @@ else() ...@@ -94,7 +94,7 @@ else()
endif() endif()
set_target_properties(linphone-gtk PROPERTIES OUTPUT_NAME linphone LINKER_LANGUAGE CXX) set_target_properties(linphone-gtk PROPERTIES OUTPUT_NAME linphone LINKER_LANGUAGE CXX)
target_include_directories(linphone-gtk PUBLIC ${GTK2_INCLUDE_DIRS} ${INTL_INCLUDE_DIRS}) target_include_directories(linphone-gtk PUBLIC ${GTK2_INCLUDE_DIRS} ${INTL_INCLUDE_DIRS})
target_link_libraries(linphone-gtk linphone ${GTK2_LIBRARIES}) target_link_libraries(linphone-gtk linphone ${GTK2_LIBRARIES} ${BCTOOLBOX_LIBRARIES} ${ORTP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES})
if(INTL_FOUND) if(INTL_FOUND)
target_link_libraries(linphone-gtk ${INTL_LIBRARIES}) target_link_libraries(linphone-gtk ${INTL_LIBRARIES})
endif() endif()
......
...@@ -21,9 +21,19 @@ ...@@ -21,9 +21,19 @@
############################################################################ ############################################################################
if(ENABLE_STATIC) if(ENABLE_STATIC)
set(LINPHONE_LIBS_FOR_TOOLS linphone-static) set(LINPHONE_LIBS_FOR_TESTER linphone-static)
else() else()
set(LINPHONE_LIBS_FOR_TOOLS linphone) set(LINPHONE_LIBS_FOR_TESTER linphone)
endif()
set(OTHER_LIBS_FOR_TESTER ${BCTOOLBOX_LIBRARIES} ${BCTOOLBOX_TESTER_LIBRARIES} ${ORTP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} ${BELLESIP_LIBRARIES} ${XML2_LIBRARIES})
if(INTL_FOUND)
list(APPEND OTHER_LIBS_FOR_TESTER ${INTL_LIBRARIES})
endif()
if(SQLITE3_FOUND)
list(APPEND OTHER_LIBS_FOR_TESTER ${SQLITE3_LIBRARIES})
endif()
if(ZLIB_FOUND)
list(APPEND OTHER_LIBS_FOR_TESTER ${ZLIB_LIBRARIES})
endif() endif()
set(RESOURCES_FILES set(RESOURCES_FILES
...@@ -80,7 +90,7 @@ if(ANDROID OR IOS) ...@@ -80,7 +90,7 @@ if(ANDROID OR IOS)
add_library(linphonetester STATIC ${SOURCE_FILES_C}) add_library(linphonetester STATIC ${SOURCE_FILES_C})
endif() endif()
target_include_directories(linphonetester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) target_include_directories(linphonetester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(linphonetester linphone ${BCTOOLBOX_TESTER_LIBRARIES}) target_link_libraries(linphonetester linphone ${OTHER_LIBS_FOR_TESTER})
install(TARGETS linphonetester install(TARGETS linphonetester
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
...@@ -94,7 +104,7 @@ if(ANDROID OR IOS) ...@@ -94,7 +104,7 @@ if(ANDROID OR IOS)
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_library(linphone_tester_static STATIC ${SOURCE_FILES_C}) add_library(linphone_tester_static STATIC ${SOURCE_FILES_C})
target_include_directories(linphone_tester_static PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) target_include_directories(linphone_tester_static PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(linphone_tester_static linphone ${BCTOOLBOX_TESTER_LIBRARIES}) target_link_libraries(linphone_tester_static linphone ${OTHER_LIBS_FOR_TESTER})
set(RUNTIME_COMPONENT_SOURCES set(RUNTIME_COMPONENT_SOURCES
liblinphone_tester_windows.cpp liblinphone_tester_windows.cpp
...@@ -133,7 +143,7 @@ if (NOT ANDROID AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ...@@ -133,7 +143,7 @@ if (NOT ANDROID AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
endif() endif()
set_target_properties(liblinphone_tester PROPERTIES LINKER_LANGUAGE CXX) set_target_properties(liblinphone_tester PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(liblinphone_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS}) target_include_directories(liblinphone_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(liblinphone_tester ${LINPHONE_LIBS_FOR_TOOLS} ${BCTOOLBOX_TESTER_LIBRARIES}) target_link_libraries(liblinphone_tester ${LINPHONE_LIBS_FOR_TESTER} ${OTHER_LIBS_FOR_TESTER})
if (GTK2_FOUND) if (GTK2_FOUND)
target_compile_definitions(liblinphone_tester PRIVATE HAVE_GTK) target_compile_definitions(liblinphone_tester PRIVATE HAVE_GTK)
target_include_directories(liblinphone_tester PUBLIC ${GTK2_INCLUDE_DIRS}) target_include_directories(liblinphone_tester PUBLIC ${GTK2_INCLUDE_DIRS})
......
...@@ -65,7 +65,7 @@ add_definitions( ...@@ -65,7 +65,7 @@ add_definitions(
apply_compile_flags(LP_AUTO_ANSWER_SOURCE_FILES "CPP" "C") apply_compile_flags(LP_AUTO_ANSWER_SOURCE_FILES "CPP" "C")
add_executable(lp-auto-answer ${LP_AUTO_ANSWER_SOURCE_FILES}) add_executable(lp-auto-answer ${LP_AUTO_ANSWER_SOURCE_FILES})
target_link_libraries(lp-auto-answer linphone) target_link_libraries(lp-auto-answer linphone ${BCTOOLBOX_LIBRARIES} ${ORTP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES})
install(TARGETS lp-auto-answer install(TARGETS lp-auto-answer
...@@ -85,7 +85,7 @@ add_definitions( ...@@ -85,7 +85,7 @@ add_definitions(
apply_compile_flags(LP_SENDMSG_SOURCE_FILES "CPP" "C") apply_compile_flags(LP_SENDMSG_SOURCE_FILES "CPP" "C")
add_executable(lp-sendmsg ${LP_SENDMSG_SOURCE_FILES}) add_executable(lp-sendmsg ${LP_SENDMSG_SOURCE_FILES})
target_link_libraries(lp-sendmsg linphone) target_link_libraries(lp-sendmsg linphone ${ORTP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES})
install(TARGETS lp-sendmsg install(TARGETS lp-sendmsg
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment