2019-12-23 14:01:00 +08:00
|
|
|
|
aux_source_directory(. TEST_SRC_LIST)
|
|
|
|
|
foreach(TEST_SRC ${TEST_SRC_LIST})
|
|
|
|
|
STRING(REGEX REPLACE "^\\./|\\.c[a-zA-Z0-9_]*$" "" TEST_EXE_NAME ${TEST_SRC})
|
2022-05-25 16:06:30 +08:00
|
|
|
|
|
|
|
|
|
if (NOT ENABLE_FFMPEG)
|
|
|
|
|
# 过滤掉依赖 FFmpeg 的测试模块
|
|
|
|
|
if ("${TEST_EXE_NAME}" MATCHES "player_opencv")
|
|
|
|
|
continue()
|
|
|
|
|
endif ()
|
|
|
|
|
endif ()
|
|
|
|
|
|
2019-12-23 14:01:00 +08:00
|
|
|
|
message(STATUS "add c api tester:${TEST_EXE_NAME}")
|
|
|
|
|
set(exe_name api_tester_${TEST_EXE_NAME})
|
|
|
|
|
add_executable(${exe_name} ${TEST_SRC})
|
2022-02-17 10:33:42 +08:00
|
|
|
|
if(USE_SOLUTION_FOLDERS)
|
|
|
|
|
SET_PROPERTY(TARGET ${exe_name} PROPERTY FOLDER "api_test")
|
|
|
|
|
endif()
|
2019-12-23 14:01:00 +08:00
|
|
|
|
|
2021-06-29 17:44:35 +08:00
|
|
|
|
if(MSVC)
|
2019-12-23 14:01:00 +08:00
|
|
|
|
set_target_properties(${exe_name} PROPERTIES COMPILE_FLAGS ${VS_FALGS} )
|
2021-06-29 17:44:35 +08:00
|
|
|
|
endif()
|
2019-12-23 14:01:00 +08:00
|
|
|
|
|
2019-12-27 12:03:54 +08:00
|
|
|
|
target_link_libraries(${exe_name} mk_api)
|
2019-12-23 14:01:00 +08:00
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|