Files
sunhpc-soft/CMakeLists.txt
2026-06-14 23:45:57 +08:00

66 lines
1.8 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.16)
# 固定 cmake 脚本目录
set(CMAKE_SCRIPT_DIR "${CMAKE_SOURCE_DIR}/cmake")
# 【关键】用完整路径引入公共脚本,不再依赖 MODULE_PATH
include(${CMAKE_SCRIPT_DIR}/Common.cmake)
include(${CMAKE_SCRIPT_DIR}/Software.cmake)
# 先检测并自动安装编译器
CheckAndInstallCompiler()
# 编译器就绪后再初始化工程与语言
project(
SoftwareDeploy
VERSION 1.0.0
DESCRIPTION "Sunhpc hpc soft build scripts application"
HOMEPAGE_URL "https://www.sunhpc.com"
)
enable_language(C CXX)
# 引入其余通用脚本
include(${CMAKE_SCRIPT_DIR}/DnfInstall.cmake)
include(${CMAKE_SCRIPT_DIR}/SrcBuild.cmake)
include(${CMAKE_SCRIPT_DIR}/ModuleEnv.cmake)
# 宏调用去掉括号和函数之间的空格CMake 宏语法要求
DEPLOY_MSG("===== Start Software Deployment Framework =====")
DEPLOY_MSG("Install Root: ${INSTALL_ROOT}")
DEPLOY_MSG("Modules Root: ${MODULES_ROOT}")
# 分组加载
if(ENABLE_SOFT_GROUP)
DEPLOY_MSG(">>> Enter Core Software Group (MPI/VASP/Amber)")
add_subdirectory(groups/soft_group)
endif()
if(ENABLE_TOOL_GROUP)
DEPLOY_MSG(">>> Enter System Tool Group (DHCPD/HTTPD)")
add_subdirectory(groups/tool_group)
endif()
if(ENABLE_ASST_GROUP)
DEPLOY_MSG(">>> Enter Assist & Modules Env Group")
add_subdirectory(groups/asst_group)
endif()
if(INSTALL_FFTW)
DEPLOY_MSG(">>> Enter FFTW & Module Env Group")
add_subdirectory(groups/soft_group)
endif()
if(INSTALL_HTTPD)
DEPLOY_MSG(">>> Enter DNF/YUM Install ...")
add_subdirectory(groups/tool_group)
endif()
if(INSTALL_DHCPD)
DEPLOY_MSG(">>> Enter DNF/YUM Install ...")
add_subdirectory(groups/tool_group)
endif()