forked from ForestClaw/forestclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
156 lines (93 loc) · 2.36 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
cmake_minimum_required(VERSION 3.13...3.20)
project(FORESTCLAW
DESCRIPTION "Quadtree/octree adaptive PDE solver based based on p4est."
HOMEPAGE_URL https://github.com/ForestClaw/forestclaw
LANGUAGES C CXX Fortran
VERSION 1.0.0)
include(CTest)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
set(CMAKE_CXX_STANDARD 17)
# --- user options
include(cmake/options.cmake)
message(STATUS "${PROJECT_NAME} ${PROJECT_VERSION} install prefix: ${CMAKE_INSTALL_PREFIX}")
# --- external libs
if(mpi)
find_package(MPI COMPONENTS C CXX REQUIRED)
endif()
if(cudaclaw)
enable_language(CUDA)
set(CMAKE_CUDA_STANDARD 14)
find_package(CUDAToolkit REQUIRED)
endif()
#find_package(LAPACK)
#find_package(BLAS)
find_package(ZLIB)
# --- p4est, sc
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG true)
if(NOT sc_external)
find_package(SC HINTS ${THUNDEREGG_ROOT} ${P4EST_ROOT})
endif()
if(NOT TARGET SC::SC)
include(cmake/sc.cmake)
endif()
if(NOT p4est_external)
find_package(P4EST HINTS ${THUNDEREGG_ROOT})
endif()
if(NOT TARGET P4EST::P4EST)
include(cmake/p4est.cmake)
endif()
# --- ThunderEgg
if(thunderegg)
if(NOT thunderegg_external)
find_package(ThunderEgg HINTS ${THUNDEREGG_ROOT})
endif()
if(NOT TARGET ThunderEgg::ThunderEgg)
include(cmake/ThunderEgg.cmake)
endif()
endif(thunderegg)
if(cudaclaw)
endif(cudaclaw)
# --- configure
include(cmake/config.cmake)
include(cmake/compilers.cmake)
# --- test
if(BUILD_TESTING)
add_subdirectory(test)
endif(BUILD_TESTING)
# --- ForestClaw
add_subdirectory(src)
# --- Clawpatch
if(clawpatch)
add_subdirectory(src/patches/clawpatch)
endif(clawpatch)
# --- Clawpack 4.6
if(clawpack4.6)
add_subdirectory(src/solvers/fc2d_clawpack4.6)
endif(clawpack4.6)
# --- Clawpack 5
if(clawpack5)
add_subdirectory(src/solvers/fc2d_clawpack5)
endif(clawpack5)
# --- geoclaw
if(geoclaw)
add_subdirectory(src/solvers/fc2d_geoclaw)
endif(geoclaw)
# --- cudaclaw
if(cudaclaw)
add_subdirectory(src/solvers/fc2d_cudaclaw)
endif(cudaclaw)
# --- ThunderEgg
if(thunderegg)
add_subdirectory(src/solvers/fc2d_thunderegg)
endif(thunderegg)
# --- package
# --- clawpack3
if(clawpack3_46)
add_subdirectory(src/solvers/fc3d_clawpack46)
endif(clawpack3_46)
include(cmake/pkgconf.cmake)
include(cmake/install.cmake)
# --- examples
if(applications)
add_subdirectory(applications)
endif(applications)