forked from GridTools/gridtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
84 lines (68 loc) · 1.87 KB
/
CMakeLists.txt
File metadata and controls
84 lines (68 loc) · 1.87 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.14.5)
cmake_policy(SET CMP0048 NEW)
file(STRINGS "version.txt" __GT_VERSION)
project(GridTools VERSION ${__GT_VERSION} LANGUAGES CXX)
unset(__GT_VERSION)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(CTest)
# ===============
# Load some cmake modules.
# 1) define what flags should be available,
include(detect_features)
detect_cuda()
detect_openmp()
detect_mpi()
include(flags)
if(POLICY CMP0060)
# Policy to avoid cmake to substitute libraries with paths and extensions with -l<libname>
cmake_policy(SET CMP0060 NEW)
endif()
# ===============
# Load some cmake modules.
# 2) package by name finder
# 3) testing methods
# 4) build configurator (include path, compiler flags, etc.
# ===============
include(definitions)
if (BUILD_TESTING)
include(testing)
endif()
include(FetchContent)
FetchContent_Declare(
cpp_bindgen
GIT_REPOSITORY https://github.com/GridTools/cpp_bindgen.git
GIT_TAG master
)
# Enable legacy mode for CPP_BINDGEN for users of GT 1.0
# TODO remove in GT 2.0
set(CPP_BINDGEN_GT_LEGACY ON)
FetchContent_MakeAvailable(cpp_bindgen)
add_subdirectory(src)
# ===============
# tests
# ===============
if(BUILD_TESTING)
add_subdirectory(regression)
add_subdirectory(unit_tests)
add_subdirectory(docs_src/manuals/getting_started)
endif()
# ===============
# examples
# ===============
if(GT_INSTALL_EXAMPLES)
add_subdirectory(examples)
endif()
# ===============
# Downloads the gridtools_experimental repository
# ===============
if(GT_ENABLE_EXPERIMENTAL_REPOSITORY)
include(gridtools_experimental/download_gridtools_experimental)
endif()
# ===============
# Python scripts
# ===============
if(GT_ENABLE_PYUTILS)
add_subdirectory(pyutils)
endif()
# absolute path to avoid collision with "export" from other packages
include(${CMAKE_CURRENT_LIST_DIR}/cmake/export.cmake)