forked from sxs-collaboration/spectre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
123 lines (102 loc) · 3.32 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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Distributed under the MIT License.
# See LICENSE.txt for details.
cmake_minimum_required(VERSION 3.3.2)
# Fortran below is needed for SPHEREPACK.
project(SpECTRE VERSION 0.0.0 LANGUAGES CXX C Fortran)
set(CMAKE_VERBOSE_MAKEFILE OFF)
site_name(HOSTNAME)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
option(
DOCS_ONLY
"Skip all initialization not required for rendering documentation"
)
if (DOCS_ONLY)
include(SetupDoxygen)
return()
endif (DOCS_ONLY)
include(CheckCompilerVersion)
include(ProhibitInSourceBuild)
include(SetupNinjaColors)
include(SetOutputDirectory)
include(SetupGitHooks)
include(SetBuildType)
include(SetupPic)
include(SetCxxStandard)
include(SetupBuildInfo)
include(SetupCCache)
include(SetupVersionFile)
include(SetupCraySupport)
include(SetupCharm)
include(SetupCharmProjections)
include(SetupMacOsx)
include(EnableWarnings)
include(SetupGoldOrLldLinker)
# In order to use certain code analysis tools like clang-tidy and cppcheck the
# compile commands need to be accessible. CMake can write these to a
# "compile_commands.json" file.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(SetupLIBCXX)
include(SetupCxxFlags)
include(SetupSanitizers)
include(SetupListTargets)
include(AddSpectreExecutable)
include(CheckBrokenArray0)
# Need to load python libs before boost.python.
include(SetupPythonLibs)
include(SetupBlas)
include(SetupBlaze)
include(SetupBoost)
include(SetupBrigand)
include(SetupCatch)
include(SetupGoogleBenchmark)
include(SetupGsl)
include(SetupHdf5)
include(SetupAllocator)
include(SetupLIBXSMM)
include(SetupLapack)
include(SetupNumPy)
include(SetupPapi)
include(SetupPybind11)
include(SetupSciPy)
include(SetupLibsharp)
include(SetupYamlCpp)
include(SetupLIBCXXCharm)
include(SpectreSetupPythonPackage)
# The precompiled header must be setup after all libraries have been found
include(SetupPch)
# All special targets and configs that need to be applied to *all*
# executables must be added at once in the 'UpdateAddExecutables' file.
# This is because of what is likely a bug in CMake where if a function is
# overridden multiple times (using the _function_name(...) method) then some
# versions of CMake (at least 3.13.2) segfault.
include(UpdateAddExecutables)
# The ClangFormat, clang-tidy, CppCheck, Doxygen, and CodeCov are intentionally
# after the PCH setup because that way they are able to change their
# dependencies on the PCH if necessary.
include(SetupClangFormat)
include(SetupClangTidy)
include(SetupIwyu)
include(SetupCppCheck)
include(SetupDoxygen)
include(CodeCoverageDetection)
include(SpectreAddLibraries)
# Generate Charm++ files
generate_algorithms(${CMAKE_BINARY_DIR}/src/Parallel/Algorithms)
enable_testing(true)
include(SpectreAddTestLibs)
include(SpectreAddCatchTests)
include(AddInputFileTests)
include(SetupCompilationFailureTests)
include_directories(${CMAKE_SOURCE_DIR}/external)
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR})
# Charm++ generated headers are created in the build directory
spectre_include_directories(${CMAKE_BINARY_DIR})
spectre_include_directories(${CMAKE_BINARY_DIR}/src)
spectre_include_directories(${CMAKE_BINARY_DIR}/src/Parallel)
add_subdirectory(external)
add_subdirectory(src)
add_subdirectory(tests)
# Set up stages for compiling test libraries in subsets.
include(SetupBuildStageTargets)
include(PrintUsefulCMakeInfo)