-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
CMakeLists.txt
45 lines (32 loc) · 1.19 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
cmake_minimum_required(VERSION 3.19...3.30)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Please specify build directory like:
cmake -B build")
endif()
project(Fortran2018Examples
LANGUAGES Fortran
DESCRIPTION "Example of using modern Fortran syntax"
VERSION 1.4.0)
enable_testing()
include(CheckSourceCompiles)
include(CheckSourceRuns)
# --- compiler checks
set(f2003features f03abstract f03charalloc f03ieee f03utf8 f03selectType)
set(f2008features f08contig f08execute f08kind)
set(f2018features f18abstract f18assumed_rank f18prop f18random f2018rank)
set(f2023features f2023rank_integer f2023ternary f2023tokenize f2023real16)
foreach(i IN LISTS f2003features f2008features f2018features f2023features)
include(cmake/${i}.cmake)
endforeach()
include(cmake/compilers.cmake)
set(CMAKE_Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}/include)
# for ease of use
foreach(a IN ITEMS array character compile debug io maximum namelist
overloading pointer real standard submodule)
add_subdirectory(test/${a})
endforeach()
foreach(a IN ITEMS git system)
add_subdirectory(src/${a})
endforeach()
file(GENERATE OUTPUT .gitignore CONTENT "*")
include(cmake/features.cmake)