-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
67 lines (53 loc) · 2.14 KB
/
Copy pathCMakeLists.txt
File metadata and controls
67 lines (53 loc) · 2.14 KB
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
cmake_minimum_required(VERSION 3.14)
# 3.14 for check_fortran_source_runs & fetchcontent
# 3.15 for robust Python finding
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "use cmake -B build or similar to avoid building in-source, which is messy")
endif()
set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo;Debug" CACHE STRING "Build type selections" FORCE)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "default build type")
endif()
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
cmake_policy(SET CMP0094 NEW)
endif()
project(gemini3d
LANGUAGES C Fortran # MUST include C language for Intel / MKL to work
DESCRIPTION "3-D ionospheric model"
HOMEPAGE_URL https://github.com/gemini3d/gemini
VERSION 0.5.6)
enable_testing()
include(CTest) # for CDash
if(realbits EQUAL 32)
message(VERBOSE " 32-bit real precision")
set(arith s)
else()
message(VERBOSE " 64-bit real precision")
set(realbits 64)
set(arith d)
endif()
option(autobuild "autobuild missing Lapack, Scalapack or Mumps" on)
option(glow "use NCAR GLOW airglow / aurora model" on)
option(hdf5 "use HDF5 file I/O" on)
option(netcdf "use NetCDF file I/O" off)
# MUMPS build options (only used if auto-building MUMPS)
option(metis "MUMPS: use METIS" off)
option(scotch "MUMPS: use Scotch" off)
option(openmp "MUMPS: use OpenMP" off)
# on: debug, off: normal
set(FETCHCONTENT_UPDATES_DISCONNECTED off)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/h5fortran.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nc4fortran.cmake)
# do these after h5fortran to avoid h5fortran HDF5OK threads test failure
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/compilers.cmake)
# first this to get libs
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/mumps.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/compiler_flags.cmake)
# this comes last to avoid intermittent failures
# self-test simulations
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/test_setup.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/test_sim.cmake)
add_subdirectory(src)
# summary print
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/summary.cmake)