forked from gemini3d/gemini3d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (51 loc) · 1.79 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
cmake_minimum_required(VERSION 3.20...3.21)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug or Release")
endif()
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION PROJECT_VERSION
REGEX "^([0-9]+\.[0-9]+\.[0-9]+)" LIMIT_INPUT 16 LENGTH_MAXIMUM 16 LIMIT_COUNT 1)
project(gemini3d
LANGUAGES C Fortran
# Gemini3D is Fortran, but external libraries use C, and some find_package need C.
DESCRIPTION "3-D ionospheric model"
HOMEPAGE_URL https://github.com/gemini3d/gemini
VERSION ${PROJECT_VERSION})
enable_testing() # keep this so BUILD_TESTING=off doesn't remove all tests
include(CTest) # for CDash
include(cmake/package/git_rev.cmake)
include(cmake/config/options.cmake)
include(cmake/config/libraries.cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/)
if(mpi)
find_package(MPI COMPONENTS C Fortran REQUIRED)
else()
add_subdirectory(src/vendor/mpi_stubs)
endif()
include(cmake/ext_libs/h5fortran.cmake)
include(cmake/ext_libs/nc4fortran.cmake)
# do these after h5fortran to avoid threads test failure
include(cmake/compilers/compilers.cmake)
# first this to get libs
include(cmake/ext_libs/mumps.cmake)
include(cmake/compilers/flags.cmake)
# flags.cmake comes last to avoid intermittent failures
# utility
include(cmake/SetTargProps.cmake)
# unit test DLL paths
include(cmake/test/lib_path.cmake)
# all Gemini3D source code under this
add_subdirectory(src)
# self-test simulations -- after all targets for if(TARGET ...)
if(matlab)
include(cmake/ext_libs/matlab.cmake)
endif(matlab)
if(python)
include(cmake/ext_libs/python.cmake)
endif(python)
include(cmake/test/config.cmake)
include(cmake/test/sim.cmake)
# summary print
include(cmake/config/summary.cmake)
# packaging
include(cmake/package/pkgconf.cmake)
include(cmake/package/install.cmake)