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)
|
2021-06-26 17:10:42 +08:00
|
|
|
|
# 暂时过滤掉依赖 WebRTC 的测试模块
|
2021-06-29 17:44:35 +08:00
|
|
|
|
if ("${TEST_SRC}" MATCHES "test_rtcp_nack\.cpp")
|
2021-06-26 17:10:42 +08:00
|
|
|
|
continue()
|
2021-06-29 17:44:35 +08:00
|
|
|
|
endif ()
|
|
|
|
|
endif ()
|
2017-12-01 11:42:49 +08:00
|
|
|
|
STRING(REGEX REPLACE "^\\./|\\.c[a-zA-Z0-9_]*$" "" TEST_EXE_NAME ${TEST_SRC})
|
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 ()
|
|
|
|
|
|
2021-06-25 22:03:52 +08:00
|
|
|
|
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)
|
2021-06-25 22:03:52 +08:00
|
|
|
|
else ()
|
2021-06-29 17:44:35 +08:00
|
|
|
|
target_link_libraries(${TEST_EXE_NAME} ${LINK_LIB_LIST})
|
2021-06-25 22:03:52 +08:00
|
|
|
|
endif ()
|
2021-06-29 17:44:35 +08:00
|
|
|
|
endforeach ()
|
2017-05-08 18:03:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|