gctl_optimization/CMakeLists.txt
2025-04-23 14:19:54 +08:00

30 lines
1004 B
CMake
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

cmake_minimum_required(VERSION 3.15.2)
# 设置项目名称与语言
project(GCTL_OPTIMIZATION VERSION 2.0)
# 添加配置配件编写的函数
include(CMakePackageConfigHelpers)
# ExprTK库在macOS 15.4中编译会有错误 添加以下命令对应检查项
add_compile_options(-Wno-missing-template-arg-list-after-template-kw)
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
message(STATUS "Install prefix: " ${CMAKE_INSTALL_PREFIX})
message(STATUS "Processor: " ${CMAKE_HOST_SYSTEM_PROCESSOR})
option(GCTL_OPTIMIZATION_TOML "Use the TOML library" ON)
message(STATUS "[GCTL_OPTIMIZATION] Use the TOML library: " ${GCTL_OPTIMIZATION_TOML})
find_package(GCTL REQUIRED)
include_directories(${GCTL_INC_DIR})
# 加入一个头文件配置让cmake对源码进行操作
configure_file(
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_SOURCE_DIR}/lib/optimization/gctl_optimization_config.h"
)
# 添加库源文件地址
add_subdirectory(lib)
add_subdirectory(example)
add_subdirectory(tool)