ZLMediaKit/tests/CMakeLists.txt

38 lines
893 B
CMake
Raw Normal View History

2019-04-16 17:25:19 +08:00
execute_process(COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/ssl.p12 ${EXECUTABLE_OUTPUT_PATH}/)
2017-05-02 23:43:10 +08:00
aux_source_directory(. TEST_SRC_LIST)
2017-06-03 10:52:49 +08:00
2021-06-29 17:44:35 +08:00
foreach (TEST_SRC ${TEST_SRC_LIST})
if (NOT ENABLE_WEBRTC)
# 暂时过滤掉依赖 WebRTC 的测试模块
2021-06-29 17:44:35 +08:00
if ("${TEST_SRC}" MATCHES "test_rtcp_nack\.cpp")
continue()
2021-06-29 17:44:35 +08:00
endif ()
endif ()
get_filename_component(TEST_EXE_NAME ${TEST_SRC} NAME_WE)
2018-03-21 15:13:33 +08:00
message(STATUS "add test:${TEST_EXE_NAME}")
2017-12-01 11:42:49 +08:00
add_executable(${TEST_EXE_NAME} ${TEST_SRC})
2019-05-31 12:14:51 +08:00
2021-06-29 17:44:35 +08:00
if (MSVC)
set_target_properties(${TEST_EXE_NAME} PROPERTIES COMPILE_FLAGS ${VS_FALGS})
endif ()
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
2021-06-29 17:44:35 +08:00
target_link_libraries(${TEST_EXE_NAME} -Wl,--start-group ${LINK_LIB_LIST} -Wl,--end-group)
else ()
2021-06-29 17:44:35 +08:00
target_link_libraries(${TEST_EXE_NAME} ${LINK_LIB_LIST})
endif ()
2021-06-29 17:44:35 +08:00
endforeach ()
2017-05-08 18:03:43 +08:00