-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMacros.cmake
37 lines (32 loc) · 1.25 KB
/
Macros.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#
# Use this file to include the relevant macros based on
# machine/compiler settings. This file gets copied to CASEROOT
# and that's the one that gets included by the build system. Feel free
# to modify this file in the CASEROOT.
#
set(MACROS_DIR ${CASEROOT}/cmake_macros)
set(UNIVERSAL_MACRO ${MACROS_DIR}/universal.cmake)
set(COMPILER_MACRO ${MACROS_DIR}/${COMPILER}.cmake)
set(OS_MACRO ${MACROS_DIR}/${OS}.cmake)
set(MACHINE_MACRO ${MACROS_DIR}/${MACH}.cmake)
set(COMPILER_OS_MACRO ${MACROS_DIR}/${COMPILER}_${OS}.cmake)
set(COMPILER_MACHINE_MACRO ${MACROS_DIR}/${COMPILER}_${MACH}.cmake)
if (CONVERT_TO_MAKE)
get_cmake_property(VARS_BEFORE_BUILD_INTERNAL_IGNORE VARIABLES)
endif()
# Include order defines precedence
foreach (MACRO_FILE ${UNIVERSAL_MACRO} ${COMPILER_MACRO} ${OS_MACRO} ${MACHINE_MACRO} ${COMPILER_OS_MACRO} ${COMPILER_MACHINE_MACRO})
if (EXISTS ${MACRO_FILE})
include(${MACRO_FILE})
else()
message("No macro file found: ${MACRO_FILE}")
endif()
endforeach()
if (CONVERT_TO_MAKE)
get_cmake_property(VARS_AFTER VARIABLES)
foreach (VAR_AFTER IN LISTS VARS_AFTER)
if (NOT VAR_AFTER IN_LIST VARS_BEFORE_BUILD_INTERNAL_IGNORE)
message("CIME_SET_MAKEFILE_VAR ${VAR_AFTER} := ${${VAR_AFTER}}")
endif()
endforeach()
endif()