-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
49 lines (38 loc) · 1.43 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
cmake_minimum_required(VERSION 3.13)
# Set the project name to your project name, my project isn't very descriptive
project(catnav2 LANGUAGES CXX)
include(cmake/StandardProjectSettings.cmake)
# Link this 'library' to set the c++ standard / compile-time options requested
add_library(project_options INTERFACE)
target_compile_features(project_options INTERFACE cxx_std_17)
# Link this 'library' to use the warnings specified in CompilerWarnings.cmake
add_library(project_warnings INTERFACE)
# standard compiler warnings
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)
# sanitizer options if supported by compiler
include(cmake/Sanitizers.cmake)
enable_sanitizers(project_options)
# enable doxygen
include(cmake/Doxygen.cmake)
enable_doxygen()
# allow for static analysis options
include(cmake/StaticAnalyzers.cmake)
option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" OFF)
option(ENABLE_TESTING "Enable Test Builds" ON)
# Very basic PCH example
option(ENABLE_PCH "Enable Precompiled Headers" ON)
if(ENABLE_PCH)
# This sets a global PCH parameter, each project will build its own PCH, which
# is a good idea if any #define's change
#
target_precompile_headers(project_options INTERFACE <vector> <string> <queue>
<utility>)
endif()
if(ENABLE_TESTING)
enable_testing()
message("Building Tests.")
add_subdirectory(test)
endif()
add_subdirectory(lib)
add_subdirectory(src)