Commit cc856557 authored by Ghislain MARY's avatar Ghislain MARY

Find tester component of bctoolbox for tester build + do not use object library.

parent 039dc443
......@@ -98,11 +98,12 @@ endif()
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_bellesip_CONFIG_DIR}/BelleSIPConfig.cmake")
include("${EP_ms2_CONFIG_DIR}/Mediastreamer2Config.cmake")
set(BcToolbox_FIND_COMPONENTS tester)
include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake")
else()
find_package(BelleSIP REQUIRED)
find_package(Mediastreamer2 REQUIRED)
find_package(BcToolbox REQUIRED)
find_package(BcToolbox REQUIRED OPTIONAL_COMPONENTS tester)
endif()
find_package(XML2 REQUIRED)
find_package(Zlib)
......@@ -176,7 +177,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}/coreapi/
${BELLESIP_INCLUDE_DIRS}
${MEDIASTREAMER2_INCLUDE_DIRS}
${BCTOOLBOX_INCLUDE_DIRS}
${BCTOOLBOX_CORE_INCLUDE_DIRS}
)
if(ENABLE_TUNNEL)
include_directories(${TUNNEL_INCLUDE_DIRS})
......@@ -283,7 +284,7 @@ endif()
if(ENABLE_TOOLS)
add_subdirectory(tools)
endif()
if(ENABLE_UNIT_TESTS)
if(ENABLE_UNIT_TESTS AND BCTOOLBOX_TESTER_FOUND)
add_subdirectory(tester)
endif()
......
......@@ -36,7 +36,11 @@ endif()
find_package(Mediastreamer2 REQUIRED)
find_package(BelleSIP REQUIRED)
if(@ENABLE_TUNNEL@)
find_package(Tunnel)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_tunnel_CONFIG_DIR}/TunnelConfig.cmake")
else()
find_package(Tunnel)
endif()
endif()
get_filename_component(LINPHONE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
......
......@@ -149,7 +149,7 @@ apply_compile_flags(LINPHONE_SOURCE_FILES_CXX "CPP" "CXX")
apply_compile_flags(LINPHONE_SOURCE_FILES_OBJC "CPP" "OBJC")
set(LIBS
${BCTOOLBOX_LIBRARIES}
${BCTOOLBOX_CORE_LIBRARIES}
${BELLESIP_LIBRARIES}
${MEDIASTREAMER2_LIBRARIES}
${XML2_LIBRARIES}
......@@ -176,13 +176,10 @@ if(INTL_FOUND)
list(APPEND LIBS ${INTL_LIBRARIES})
endif()
add_library(linphone-objects OBJECT ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC})
set_target_properties(linphone-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
add_dependencies(linphone-objects liblinphone-git-version)
if(ENABLE_STATIC)
add_library(linphone-static STATIC $<TARGET_OBJECTS:linphone-objects>)
add_library(linphone-static STATIC ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC})
set_target_properties(linphone-static PROPERTIES OUTPUT_NAME linphone)
add_dependencies(linphone-static liblinphone-git-version)
target_link_libraries(linphone-static ${LIBS})
if(IOS)
target_link_libraries(linphone-static "-framework Foundation" "-framework AVFoundation")
......@@ -193,8 +190,9 @@ if(ENABLE_STATIC)
)
endif()
if(ENABLE_SHARED)
add_library(linphone SHARED $<TARGET_OBJECTS:linphone-objects>)
add_library(linphone SHARED ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC})
set_target_properties(linphone PROPERTIES VERSION ${LINPHONE_SO_VERSION} LINKER_LANGUAGE CXX)
add_dependencies(linphone liblinphone-git-version)
target_link_libraries(linphone ${LIBS})
if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set_target_properties(linphone PROPERTIES PREFIX "lib")
......
mediastreamer2 @ 7ae38a0c
Subproject commit 85798979cc2a3cbd67151128ffe83806c34c8236
Subproject commit 7ae38a0cc81e6da5b0b2b55562929a1687e4fd37
oRTP @ 82fc7076
Subproject commit 987813308e9947c4f6e3502168c7ea6775a72ff0
Subproject commit 82fc707667486072a09ba904a8cf03edf68f700e
......@@ -62,8 +62,8 @@ add_definitions(-DBC_CONFIG_FILE="config.h")
if(IOS)
add_library(linphonetester STATIC ${SOURCE_FILES})
target_include_directories(linphonetester PUBLIC ${BCTOOLBOX_INCLUDE_DIRS})
target_link_libraries(linphonetester linphone ${BCTOOLBOX_LIBRARIES})
target_include_directories(linphonetester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(linphonetester linphone ${BCTOOLBOX_TESTER_LIBRARIES})
install(TARGETS linphonetester
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
......@@ -76,8 +76,8 @@ if(IOS)
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_library(linphone_tester_static STATIC ${SOURCE_FILES})
target_include_directories(linphone_tester_static PUBLIC ${BCTOOLBOX_INCLUDE_DIRS})
target_link_libraries(linphone_tester_static linphone ${BCTOOLBOX_LIBRARIES})
target_include_directories(linphone_tester_static PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(linphone_tester_static linphone ${BCTOOLBOX_TESTER_LIBRARIES})
set(RUNTIME_COMPONENT_SOURCES
liblinphone_tester_windows.cpp
......@@ -106,8 +106,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
else()
add_executable(liblinphone_tester ${SOURCE_FILES})
set_target_properties(liblinphone_tester PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(liblinphone_tester PUBLIC ${BCTOOLBOX_INCLUDE_DIRS})
target_link_libraries(liblinphone_tester linphone ${BCTOOLBOX_LIBRARIES})
target_include_directories(liblinphone_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(liblinphone_tester linphone ${BCTOOLBOX_TESTER_LIBRARIES})
if (GTK2_FOUND)
target_compile_definitions(liblinphone_tester PRIVATE HAVE_GTK)
target_include_directories(liblinphone_tester PUBLIC ${GTK2_INCLUDE_DIRS})
......
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