Repository navigation
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
63 lines (49 loc) · 1.91 KB
/
Copy pathCMakeLists.txt
File metadata and controls
63 lines (49 loc) · 1.91 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
cmake_minimum_required(VERSION 3.19...${CMAKE_VERSION})
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
if(NOT DEFINED ${PROJECT_NAME}_BUILD_TESTING)
set(${PROJECT_NAME}_BUILD_TESTING ${BUILD_TESTING})
endif()
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/)
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)
# this comes last to avoid intermittent failures
# utility
include(cmake/SetTargProps.cmake)
# all Gemini3D source code under this
add_subdirectory(src)
if(CMAKE_VERSION VERSION_LESS 3.20)
message(STATUS "*** Gemini3D self-tests require CMake >= 3.20 ***
Recommendation: Install latest CMake by:
cmake -P ${PROJECT_SOURCE_DIR}/scripts/install_cmake.cmake")
return()
endif()
# self-test simulations -- after all targets for if(TARGET ...)
include(cmake/ext_libs/matlab.cmake)
include(cmake/ext_libs/python.cmake)
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)