Commit e57cf673 authored by Ghislain MARY's avatar Ghislain MARY

Find tester component of bctoolbox for tester build.

parent 54dbbd6f
......@@ -108,9 +108,10 @@ if(ENABLE_RTP_MAP_ALWAYS_IN_SDP)
endif()
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
set(BcToolbox_FIND_COMPONENTS tester)
include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake")
else()
find_package(BcToolbox REQUIRED)
find_package(BcToolbox REQUIRED OPTIONAL_COMPONENTS tester)
endif()
if(ENABLE_TUNNEL)
......@@ -160,7 +161,7 @@ include_directories(
src
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/src
${BCTOOLBOX_INCLUDE_DIRS}
${BCTOOLBOX_CORE_INCLUDE_DIRS}
)
if(TUNNEL_FOUND)
include_directories(${TUNNEL_INCLUDE_DIRS})
......@@ -231,7 +232,7 @@ add_subdirectory(include)
add_subdirectory(src)
if(ENABLE_TESTS)
if(ENABLE_TESTS AND BCTOOLBOX_TESTER_FOUND)
enable_testing()
add_subdirectory(tester)
endif()
......
......@@ -35,7 +35,7 @@ endif()
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake")
else()
find_package(BcToolbox REQUIRED)
find_package(BcToolbox REQUIRED COMPONENTS core)
endif()
if(@ENABLE_TUNNEL@)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
......@@ -56,8 +56,8 @@ if(@ENABLE_SHARED@)
else()
set(BELLESIP_LIBRARIES bellesip-static)
endif()
list(APPEND BELLESIP_INCLUDE_DIRS ${BCTOOLBOX_INCLUDE_DIRS})
list(APPEND BELLESIP_LIBRARIES ${BCTOOLBOX_LIBRARIES})
list(APPEND BELLESIP_INCLUDE_DIRS ${BCTOOLBOX_CORE_INCLUDE_DIRS})
list(APPEND BELLESIP_LIBRARIES ${BCTOOLBOX_CORE_LIBRARIES})
set(BELLESIP_LDFLAGS "@LINK_FLAGS_STR@")
if(TUNNEL_FOUND)
list(APPEND BELLESIP_INCLUDE_DIRS ${TUNNEL_INCLUDE_DIRS})
......
......@@ -23,8 +23,8 @@
set(INCLUDES ${ANTLR3C_INCLUDE_DIRS})
set(LIBS ${ANTLR3C_LIBRARIES})
list(APPEND INCLUDES ${BCTOOLBOX_INCLUDE_DIR})
list(APPEND LIBS ${BCTOOLBOX_LIBRARIES})
list(APPEND INCLUDES ${BCTOOLBOX_CORE_INCLUDE_DIR})
list(APPEND LIBS ${BCTOOLBOX_CORE_LIBRARIES})
if(Threads_FOUND)
if(CMAKE_USE_PTHREADS_INIT AND NOT CMAKE_SYSTEM_NAME MATCHES "QNX")
......@@ -153,14 +153,11 @@ if(BELLE_SIP_SOURCE_FILES_CXX)
apply_compile_flags(BELLE_SIP_SOURCE_FILES_CXX "CPP" "CXX")
endif()
add_library(bellesip-objects OBJECT ${BELLE_SIP_HEADER_FILES} ${BELLE_SIP_SOURCE_FILES_C} ${BELLE_SIP_SOURCE_FILES_CXX} ${BELLE_SIP_SOURCE_FILES_OBJC})
set_target_properties(bellesip-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
target_include_directories(bellesip-objects PUBLIC ${INCLUDES})
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(ENABLE_STATIC)
add_library(bellesip-static STATIC $<TARGET_OBJECTS:bellesip-objects>)
add_library(bellesip-static STATIC ${BELLE_SIP_HEADER_FILES} ${BELLE_SIP_SOURCE_FILES_C} ${BELLE_SIP_SOURCE_FILES_CXX} ${BELLE_SIP_SOURCE_FILES_OBJC})
set_target_properties(bellesip-static PROPERTIES OUTPUT_NAME bellesip)
target_include_directories(bellesip-static PUBLIC ${INCLUDES})
target_link_libraries(bellesip-static ${LIBS})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(bellesip-static PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
......@@ -171,9 +168,10 @@ if(ENABLE_STATIC)
)
endif()
if(ENABLE_SHARED)
add_library(bellesip SHARED $<TARGET_OBJECTS:bellesip-objects>)
add_library(bellesip SHARED ${BELLE_SIP_HEADER_FILES} ${BELLE_SIP_SOURCE_FILES_C} ${BELLE_SIP_SOURCE_FILES_CXX} ${BELLE_SIP_SOURCE_FILES_OBJC})
set_target_properties(bellesip PROPERTIES VERSION 0.0.0 SOVERSION 0)
set_target_properties(bellesip PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(bellesip PUBLIC ${INCLUDES})
target_link_libraries(bellesip ${LIBS})
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(bellesip PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
......
......@@ -47,8 +47,8 @@ apply_compile_flags(TESTER_SOURCES "CPP" "C")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_library(belle_sip_tester_static STATIC ${TESTER_SOURCES})
target_include_directories(belle_sip_tester_static PUBLIC ${BCTOOLBOX_INCLUDE_DIRS})
target_link_libraries(belle_sip_tester_static ${BCTOOLBOX_LIBRARIES} bellesip)
target_include_directories(belle_sip_tester_static PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(belle_sip_tester_static ${BCTOOLBOX_TESTER_LIBRARIES} bellesip)
set(RUNTIME_COMPONENT_SOURCES
belle_sip_tester_windows.cpp
......@@ -80,8 +80,8 @@ else()
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_include_directories(belle_sip_tester PUBLIC ${BCTOOLBOX_INCLUDE_DIRS})
target_link_libraries(belle_sip_tester ${BCTOOLBOX_LIBRARIES} bellesip)
target_include_directories(belle_sip_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(belle_sip_tester ${BCTOOLBOX_TESTER_LIBRARIES} bellesip)
add_test(NAME belle_sip_tester COMMAND belle_sip_tester --verbose)
......
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