gctl_mesh/CMakeLists.txt
2024-09-10 20:02:00 +08:00

46 lines
1.5 KiB
CMake
Raw Permalink 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_MESH VERSION 1.0)
# 添加配置配件编写的函数
include(CMakePackageConfigHelpers)
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
message(STATUS "Install prefix: " ${CMAKE_INSTALL_PREFIX})
message(STATUS "Processor: " ${CMAKE_HOST_SYSTEM_PROCESSOR})
find_package(GCTL REQUIRED)
find_package(GCTL_GRAPHIC REQUIRED)
message(STATUS "GCTL Version: " ${GCTL_VERSION})
message(STATUS "GCTL_GRAPHIC Version: " ${GCTL_GRAPHIC_VERSION})
#if(${GCTL_VERSION} LESS 1.0)
# message(FATAL_ERROR "GCTL's version must be v1.0 or bigger.")
#endif()
option(GCTL_MESH_EXPRTK "Use the exprtk library." ON)
option(GCTL_MESH_WAVELIB "Use the WaveLib library" ON)
# 传递安装地址给编译期宏变量
option(GCTL_MESH_INSTALL_PREFIX "Pass the install directory." ON)
set(DIR_VAR ${CMAKE_INSTALL_PREFIX})
message(STATUS "[GCTL_MESH] Pass the install directory: " ${GCTL_MESH_INSTALL_PREFIX})
message(STATUS "[GCTL_MESH] Use the exprtk library: " ${GCTL_MESH_EXPRTK})
message(STATUS "[GCTL_MESH] Use the WaveLib library: " ${GCTL_MESH_WAVELIB})
if(GCTL_MESH_WAVELIB)
if(NOT WaveLib_FOUND)
find_package(WaveLib REQUIRED)
message(STATUS "Found WaveLib")
include_directories(${WaveLib_INC_DIR})
endif()
endif()
# 加入一个头文件配置让cmake对源码进行操作
configure_file(
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_SOURCE_DIR}/lib/mesh/gctl_mesh_config.h"
)
# 添加库源文件地址
add_subdirectory(lib)
add_subdirectory(tool)
add_subdirectory(example)