mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 12:11:36 +08:00
e2908e9775
* 解决msvc下链接问题 * CMAKE添加自动生成mk api export头文件 * 兼容非cmake构建时情况 Co-authored-by: baiyfcu <baiyfcu@gmail.com>
39 lines
815 B
CMake
39 lines
815 B
CMake
aux_source_directory(. TEST_SRC_LIST)
|
|
include_directories(${PROJECT_BINARY_DIR}/api)
|
|
|
|
foreach(TEST_SRC ${TEST_SRC_LIST})
|
|
STRING(REGEX REPLACE "^\\./|\\.c[a-zA-Z0-9_]*$" "" TEST_EXE_NAME ${TEST_SRC})
|
|
|
|
if (NOT ENABLE_FFMPEG)
|
|
# 过滤掉依赖 FFmpeg 的测试模块
|
|
if ("${TEST_EXE_NAME}" MATCHES "player_opencv")
|
|
continue()
|
|
endif ()
|
|
endif ()
|
|
|
|
message(STATUS "add c api tester:${TEST_EXE_NAME}")
|
|
set(exe_name api_tester_${TEST_EXE_NAME})
|
|
add_executable(${exe_name} ${TEST_SRC})
|
|
if(USE_SOLUTION_FOLDERS)
|
|
SET_PROPERTY(TARGET ${exe_name} PROPERTY FOLDER "api_test")
|
|
endif()
|
|
|
|
if(MSVC)
|
|
set_target_properties(${exe_name} PROPERTIES COMPILE_FLAGS ${VS_FALGS} )
|
|
endif()
|
|
|
|
target_link_libraries(${exe_name} mk_api)
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|