-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
53 lines (41 loc) · 1.49 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
# C++ Project template
#
# Proudly bootstrapped by git@github.com:duckie/cpp_project_template.git
#
# Version guard
cmake_minimum_required (VERSION 3.2)
# Cmake modules
include(CheckCXXSourceCompiles)
include(CheckCXXCompilerFlag)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
include(ProjectGlobalMacros)
include(ProjectTestFunctions)
# Project configuration
project (named_types)
enable_testing()
set(CMAKE_VERBOSE_MAKEFILE OFF)
# Check for C++11/14 support
project_check_cpp_version()
## Snippets to enforce a C++ version
#if (not CPP14_SUPPORT)
# message(FATAL_ERROR "C++14 support is required.")
#endif()
#if (not CPP11_SUPPORT)
# message(FATAL_ERROR "C++11 support is required.")
#endif()
# Trace compilation for tools (ex: YouCompleteMe)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
configure_file(${PROJECT_SOURCE_DIR}/cmake/BuildConfig.json.in ${PROJECT_SOURCE_DIR}/BuildConfig.json)
# Tooling - some must be declared before adding other subdirectories
project_enable_coverage_build()
project_enable_sanitizer_build()
project_enable_clang_format()
project_enable_documentation()
### MANUAL_INCLUDE_DIRS is useful to force ides to find some includes (useless for compilation) ###
### To be used by editing the cache manually
include_directories(${MANUAL_INCLUDE_DIRS})
project_add_3rdparty(catch)
# By default we put binaries into this directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
add_subdirectory(test)