-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
59 lines (49 loc) · 1.14 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
cmake_minimum_required(VERSION 3.14)
project(fsys VERSION 0.0.0)
cmake_policy(SET CMP0076 NEW)
enable_testing()
include(CTest)
include(CMakePrintHelpers)
enable_language(C)
enable_language(Fortran)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
find_program(FYPP fypp)
if(NOT FYPP)
message(FATAL_ERROR "FYPP not found.")
endif()
include(CheckFortranSourceCompiles)
include(CheckFortranSourceRuns)
check_fortran_source_runs(
"if (selected_real_kind(3) == selected_real_kind(6)) STOP 1; end"
HP_SUPPORT
)
check_fortran_source_runs(
"if (selected_real_kind(33) == -1) STOP 1; end"
QP_SUPPORT
)
check_fortran_source_runs(
"if (ANY(selected_real_kind(18) == [-1, selected_real_kind(33)])) STOP 1; end"
XDP_SUPPORT
)
set(fyppFlags)
list(
APPEND fyppFlags
"-I${PROJECT_SOURCE_DIR}/include"
)
list(
APPEND fyppFlags
"-DHP_SUPPORT=$<BOOL:${HP_SUPPORT}>"
"-DXDP_SUPPORT=$<BOOL:${XDP_SUPPORT}>"
"-DQP_SUPPORT=$<BOOL:${QP_SUPPORT}>"
"-I${PROJECT_SOURCE_DIR}/include"
)
if(WIN32)
list(
APPEND fyppFlags
"-DWIN32=$<BOOL:${WIN32}>"
)
endif()
add_subdirectory(src)
if(CMAKE_BUILD_TYPE MATCHES "Debug")
add_subdirectory(test)
endif()