gctl_seismic/CMakeLists.txt
2024-09-10 20:22:53 +08:00

35 lines
1.1 KiB
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_SEISMIC VERSION 1.0)
# 添加配置配件编写的函数
include(CMakePackageConfigHelpers)
# 添加编译选项
option(GCTL_SEISMIC_MATHGL "Use the mathGL library" ON)
message(STATUS "Platform: " ${CMAKE_HOST_SYSTEM_NAME})
message(STATUS "Install prefix: " ${CMAKE_INSTALL_PREFIX})
message(STATUS "Processor: " ${CMAKE_HOST_SYSTEM_PROCESSOR})
message(STATUS "[GCTL_SEISMIC] Use the mathGL library: " ${GCTL_SEISMIC_MATHGL})
find_package(GCTL REQUIRED)
message(STATUS "GCTL Version: " ${GCTL_VERSION})
if(${GCTL_VERSION} LESS 1.0)
message(FATAL_ERROR "GCTL's version must be v1.0 or bigger.")
endif()
if(GCTL_SEISMIC_MATHGL)
find_package(MathGL2 REQUIRED FLTK)
message(STATUS "mathGL Version: " ${MathGL2_VERSION})
include_directories(${MathGL2_INCLUDE_DIRS})
endif()
# 加入一个头文件配置让cmake对源码进行操作
configure_file(
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_SOURCE_DIR}/lib/seismic/gctl_seismic_config.h"
)
# 添加库源文件地址
add_subdirectory(lib)
add_subdirectory(exam)