Commit 7ae38a0c authored by Ghislain MARY's avatar Ghislain MARY

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

parent 85798979
......@@ -302,9 +302,10 @@ if(ENABLE_SOUND AND NOT(WIN32 OR ENABLE_ALSA OR ENABLE_ARTSC OR ENABLE_MACSND OR
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()
include_directories(
......@@ -315,7 +316,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/src
${ORTP_INCLUDE_DIRS}
${BCTOOLBOX_INCLUDE_DIRS}
${BCTOOLBOX_CORE_INCLUDE_DIRS}
)
if(BZRTP_FOUND)
......@@ -517,7 +518,7 @@ if(ENABLE_DOC)
endif()
add_subdirectory(include)
add_subdirectory(src)
if(ENABLE_UNIT_TESTS)
if(ENABLE_UNIT_TESTS AND BCTOOLBOX_TESTER_FOUND)
add_subdirectory(tester)
endif()
if(ENABLE_TOOLS)
......
......@@ -38,7 +38,7 @@ if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
include("${EP_bctoolbox_CONFIG_DIR}/BcToolboxConfig.cmake")
else()
find_package(ORTP REQUIRED)
find_package(BcToolbox REQUIRED)
find_package(BcToolbox REQUIRED COMPONENTS core)
endif()
find_package(Matroska2)
if(@ENABLE_ZRTP@)
......@@ -60,8 +60,8 @@ if(@ENABLE_SHARED@)
else()
set(MEDIASTREAMER2_LIBRARIES mediastreamer_base-static mediastreamer_voip-static)
endif()
list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${ORTP_INCLUDE_DIRS} ${BCTOOLBOX_INCLUDE_DIRS})
list(APPEND MEDIASTREAMER2_LIBRARIES ${ORTP_LIBRARIES} ${BCTOOLBOX_LIBRARIES})
list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${ORTP_INCLUDE_DIRS} ${BCTOOLBOX_CORE_INCLUDE_DIRS})
list(APPEND MEDIASTREAMER2_LIBRARIES ${ORTP_LIBRARIES} ${BCTOOLBOX_CORE_LIBRARIES})
if(MATROSKA2_FOUND)
list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${MATROSKA2_INCLUDE_DIRS})
list(APPEND MEDIASTREAMER2_LIBRARIES ${MATROSKA2_LIBRARIES})
......
......@@ -79,23 +79,21 @@ endif()
apply_compile_flags(BASE_SOURCE_FILES_C "CPP" "C")
add_library(mediastreamer_base-objects OBJECT ${MEDIASTREAMER2_HEADER_FILES} ${BASE_SOURCE_FILES_C})
set_target_properties(mediastreamer_base-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
add_dependencies(mediastreamer_base-objects ms2-git-version ms2-basedescs-header)
if(ENABLE_STATIC)
add_library(mediastreamer_base-static STATIC $<TARGET_OBJECTS:mediastreamer_base-objects>)
add_library(mediastreamer_base-static STATIC ${MEDIASTREAMER2_HEADER_FILES} ${BASE_SOURCE_FILES_C})
set_target_properties(mediastreamer_base-static PROPERTIES OUTPUT_NAME mediastreamer_base)
target_link_libraries(mediastreamer_base-static ${BASE_LIBS})
add_dependencies(mediastreamer_base-static ms2-git-version ms2-basedescs-header)
install(TARGETS mediastreamer_base-static EXPORT ${EXPORT_TARGETS_NAME}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
if(ENABLE_SHARED)
add_library(mediastreamer_base SHARED $<TARGET_OBJECTS:mediastreamer_base-objects>)
add_library(mediastreamer_base SHARED ${MEDIASTREAMER2_HEADER_FILES} ${BASE_SOURCE_FILES_C})
set_target_properties(mediastreamer_base PROPERTIES VERSION ${MEDIASTREAMER_SO_VERSION} LINKER_LANGUAGE C)
target_link_libraries(mediastreamer_base ${BASE_LIBS})
add_dependencies(mediastreamer_base ms2-git-version ms2-basedescs-header)
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/mediastreamer_base.pdb
......@@ -347,6 +345,14 @@ endif()
set(VOIP_SOURCE_FILES_ALL ${VOIP_SOURCE_FILES_C} ${VOIP_SOURCE_FILES_CXX} ${VOIP_SOURCE_FILES_OBJC})
if(FFMPEG_FOUND AND NOT WIN32)
set_source_files_properties(
videofilters/jpegwriter.c
videofilters/videoenc.c
PROPERTIES COMPILE_FLAGS "-Wno-error=deprecated-declarations"
)
endif()
add_custom_target(ms2-voipdescs-header
COMMAND ${CMAKE_COMMAND} -DAWK_PROGRAM=${AWK_PROGRAM} -DAWK_SCRIPTS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../"
-DINPUT_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR}
......@@ -389,7 +395,7 @@ endif()
set(VOIP_LIBS
${BCTOOLBOX_LIBRARIES}
${BCTOOLBOX_CORE_LIBRARIES}
${ORTP_LIBRARIES}
)
if(WIN32)
......@@ -471,28 +477,19 @@ if (CAMAPI_FOUND)
list(APPEND VOIP_LIBS ${CAMAPI_LIBRARIES})
endif()
add_library(mediastreamer_voip-objects OBJECT ${MEDIASTREAMER2_HEADER_FILES} ${VOIP_SOURCE_FILES_C} ${VOIP_SOURCE_FILES_CXX} ${VOIP_SOURCE_FILES_OBJC})
set_target_properties(mediastreamer_voip-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
add_dependencies(mediastreamer_voip-objects ms2-git-version ms2-voipdescs-header)
set(MS2_VOIP_DEPENDENCIES ms2-git-version ms2-voipdescs-header)
if(APPLE OR GLX_FOUND)
add_dependencies(mediastreamer_voip-objects ms2-yuv2rgb-fs-header ms2-yuv2rgb-vs-header)
list(APPEND MS2_VOIP_DEPENDENCIES ms2-yuv2rgb-fs-header ms2-yuv2rgb-vs-header)
endif()
if(FFMPEG_FOUND AND NOT WIN32)
set_source_files_properties(
videofilters/jpegwriter.c
videofilters/videoenc.c
PROPERTIES COMPILE_FLAGS "-Wno-error=deprecated-declarations"
)
endif()
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(ENABLE_STATIC)
add_library(mediastreamer_voip-static STATIC $<TARGET_OBJECTS:mediastreamer_voip-objects>)
add_library(mediastreamer_voip-static STATIC ${MEDIASTREAMER2_HEADER_FILES} ${VOIP_SOURCE_FILES_C} ${VOIP_SOURCE_FILES_CXX} ${VOIP_SOURCE_FILES_OBJC})
set_target_properties(mediastreamer_voip-static PROPERTIES OUTPUT_NAME mediastreamer_voip)
if(LINK_FLAGS_STR)
set_target_properties(mediastreamer_voip-static PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
add_dependencies(mediastreamer_voip-static ${MS2_VOIP_DEPENDENCIES})
target_link_libraries(mediastreamer_voip-static mediastreamer_base-static ${VOIP_LIBS})
install(TARGETS mediastreamer_voip-static EXPORT ${EXPORT_TARGETS_NAME}Targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
......@@ -500,11 +497,12 @@ if(ENABLE_STATIC)
)
endif()
if(ENABLE_SHARED)
add_library(mediastreamer_voip SHARED $<TARGET_OBJECTS:mediastreamer_voip-objects>)
add_library(mediastreamer_voip SHARED ${MEDIASTREAMER2_HEADER_FILES} ${VOIP_SOURCE_FILES_C} ${VOIP_SOURCE_FILES_CXX} ${VOIP_SOURCE_FILES_OBJC})
set_target_properties(mediastreamer_voip PROPERTIES VERSION ${MEDIASTREAMER_SO_VERSION} LINKER_LANGUAGE CXX)
if(LINK_FLAGS_STR)
set_target_properties(mediastreamer_voip PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
add_dependencies(mediastreamer_voip ${MS2_VOIP_DEPENDENCIES})
target_link_libraries(mediastreamer_voip mediastreamer_base ${VOIP_LIBS})
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
......
......@@ -53,8 +53,8 @@ apply_compile_flags(SOURCE_FILES_OBJC "CPP" "OBJC")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_library(mediastreamer2_tester_static STATIC ${SOURCE_FILES_C})
target_include_directories(mediastreamer2_tester_static PUBLIC ${BCTOOLBOX_INCLUDE_DIRS})
target_link_libraries(mediastreamer2_tester_static mediastreamer_voip mediastreamer_base ${BCTOOLBOX_LIBRARIES})
target_include_directories(mediastreamer2_tester_static PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(mediastreamer2_tester_static mediastreamer_voip mediastreamer_base ${BCTOOLBOX_TESTER_LIBRARIES})
set(RUNTIME_COMPONENT_SOURCES
mediastreamer2_tester_windows.cpp
......@@ -84,8 +84,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
else()
add_executable(mediastreamer2_tester ${SOURCE_FILES_C} ${SOURCE_FILES_OBJC})
target_include_directories(mediastreamer2_tester PUBLIC ${BCTOOLBOX_INCLUDE_DIRS})
target_link_libraries(mediastreamer2_tester mediastreamer_voip mediastreamer_base ${BCTOOLBOX_LIBRARIES})
target_include_directories(mediastreamer2_tester PUBLIC ${BCTOOLBOX_TESTER_INCLUDE_DIRS})
target_link_libraries(mediastreamer2_tester mediastreamer_voip mediastreamer_base ${BCTOOLBOX_TESTER_LIBRARIES})
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(LINK_FLAGS_STR)
set_target_properties(mediastreamer2_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
......
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