-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
80 lines (67 loc) · 1.83 KB
/
CMakeLists.txt
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
ecbuild_add_executable (
TARGET GEOSgcm.x
SOURCES GEOSgcm.F90
LIBS GEOSgcm_GridComp ESMF::ESMF OpenMP::OpenMP_Fortran
)
# NOTE Due to Gigatraj being a C++ code, CMake apparently
# gets confused if building with it and thinks GEOSgcm.x
# is a C++ code and tries to link as C++. This will fail.
# To fix this, we explicitly set the linker language to Fortran.
set_target_properties (GEOSgcm.x PROPERTIES LINKER_LANGUAGE Fortran)
# Using JeMalloc will be optional, default OFF
option (USE_JEMALLOC "Use JeMalloc" OFF)
if (USE_JEMALLOC)
find_package (JeMalloc REQUIRED)
target_link_libraries (GEOSgcm.x JeMalloc::JeMalloc)
endif ()
ecbuild_add_executable (
TARGET idfupd.x
SOURCES idfupd.F90
LIBS GEOSgcm_GridComp ESMF::ESMF
)
set_target_properties (idfupd.x PROPERTIES LINKER_LANGUAGE Fortran)
set (CMAKE_Fortran_FLAGS_RELEASE "${GEOS_Fortran_FLAGS_VECT}")
file (GLOB templates CONFIGURE_DEPENDS *.tmpl)
set (programs
gcm_run.j
gcm_regress.j
gcm_post.j
gcm_archive.j
gcm_quickplot.csh
gcm_moveplot.j
gcm_forecast.setup
gcm_emip.setup
scm_setup
gcm_quickstat.j
scm_run.j
construct_extdata_yaml_list.py
)
install (
FILES ${templates}
DESTINATION etc
)
install (
PROGRAMS ${programs}
DESTINATION bin
)
install (
FILES fvcore_layout.rc saverst.rc logging.yaml
DESTINATION etc
)
if(INSTALL_SOURCE_TARFILE)
set(CFG_INSTALL_SOURCE_TARFILE TRUE)
else()
set(CFG_INSTALL_SOURCE_TARFILE FALSE)
endif()
set (setup_scripts
gcm_setup
gmichem_setup
geoschemchem_setup
stratchem_setup
)
foreach (file ${setup_scripts})
configure_file(${file} ${file} @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION bin)
endforeach ()
configure_file(.AGCM_VERSION .AGCM_VERSION @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/.AGCM_VERSION DESTINATION etc)