-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
87 lines (65 loc) · 2.62 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
cmake_minimum_required(VERSION 3.23.0)
list(APPEND CMAKE_MESSAGE_CONTEXT DAWN)
option(LOG_WITH_INDENTATION "Indent a level when moving to processing a subdirectory" ON)
option(CMAKE_MESSAGE_CONTEXT_SHOW "Show the context of each log message" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(context)
show_context("top level CMakeLists.txt")
project(DAWN VERSION 0.1
LANGUAGES CXX)
enable_testing()
## Set the language standard flexibly, as outlined in Craig Scott's
## "Professional CMake: A Practical Guide":
# Require C++11, but let a parent project ask for something higher
if(DEFINED CMAKE_CXX_STANDARD)
if(CMAKE_CXX_STANDARD EQUAL 98 OR CMAKE_CXX_STANDARD LESS 11)
message(FATAL_ERROR "This project requires at least C++11")
endif()
else()
set(CMAKE_CXX_STANDARD 11)
endif()
# Always enforce the language constraint
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# We don't need compiler extensions, but let a parent ask for them
if(NOT DEFINED CMAKE_CXX_EXTENSIONS)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
set(CMAKE_WARN_DEPRECATED TRUE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
## User options:
option(INSTALL_BIOCRO_HEADERS "Install interface headers for the BioCro library" OFF)
option(BUILD_SHARED_LIBS "Build libraries as shared libraries by default rather than as static libraries" ON)
option(INSTALL_GTEST "Install Google Test" OFF)
option(CUSTOMIZE_DOXYGEN "Customize the Doxygen documentation" OFF)
# Set a default build type if none was specified
set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
include(GNUInstallDirs)
add_subdirectory(biocro-lib)
add_subdirectory(app)
add_subdirectory(tests)
add_subdirectory(doc)
## All install commands are at this top level:
install(TARGETS BioCro)
if(INSTALL_BIOCRO_HEADERS)
install(TARGETS BioCro
FILE_SET biocro_lib_headers # FILE_SET requires CMake >= 3.23
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/BioCro
)
endif()
install(TARGETS dawn
ARCHIVE
PUBLIC_HEADER
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dawn
)
# Install the schema files
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/dawn/
DESTINATION ${CMAKE_INSTALL_DATADIR}/dawn)
install(TARGETS runsim)