-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
CMakeLists.txt
42 lines (30 loc) · 1.03 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
cmake_minimum_required(VERSION 3.19...3.29)
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
foreach(i IN ITEMS f03abstract f03charalloc f03ieee f03utf8 f03selectType
f08contig f08execute f08kind
f18abstract f18assumed_rank f18prop f18random
f2023rank_integer f2023ternary f2023tokenize f2023real16)
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 "*")