tesseroids/test/CMakeLists.txt

20 lines
551 B
CMake
Raw Normal View History

2021-05-05 10:58:03 +08:00
# 设置编译选项
2021-05-07 09:41:30 +08:00
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
endif()
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lm -O2")
endif()
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
2021-05-05 10:58:03 +08:00
endif()
# 设置可执行文件的输出地址
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/test)
# 添加可执行程序名称
add_executable(test_all test_all.c)
# 链接动态库
2021-05-05 15:24:52 +08:00
target_link_libraries(test_all PUBLIC tess)