-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (46 loc) · 1.97 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
cmake_minimum_required(VERSION 3.10) # required for gtest_discover_tests
project(atheneum) # Replace
# Set a default build type if none was specified
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release 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 ()
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
include(CMakeDependentOption)
cmake_dependent_option(${PROJECT_NAME}_BUILD_TESTING "Build ${PROJECT_NAME} testing targets" ON "${PROJECT_NAME}_IS_TOP_LEVEL" OFF)
option(${PROJECT_NAME}_COVERAGE "Add ${PROJECT_NAME} coverage reports" OFF)
#cmake_dependent_option(${PROJECT_NAME}_BUILD_EXAMPLES "Build ${PROJECT_NAME} examples" ON "${PROJECT_NAME}_IS_TOP_LEVEL" OFF)
cmake_dependent_option(${PROJECT_NAME}_WARNINGS_AS_ERRORS "Treat warnings in ${PROJECT_NAME} as errors" ON "${PROJECT_NAME}_IS_TOP_LEVEL" OFF)
option(${PROJECT_NAME}_STATIC_LIB "Make ${PROJECT_NAME} a static library" ON)
if (NOT ${PROJECT_NAME}_STATIC_LIB)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif ()
include(build-options-interface)
# Automatic generation of version info
include(git-versioning)
process_git_version()
make_version_header()
message(STATUS "Building ${PROJECT_NAME} ${${PROJECT_NAME}_version}")
# Set up testing/coverage
if (${PROJECT_NAME}_BUILD_TESTING)
enable_testing()
if (${PROJECT_NAME}_COVERAGE)
set(ENABLE_COVERAGE ON CACHE BOOL "" FORCE)
find_package(codecov)
endif ()
endif ()
# Add subdirectories
add_subdirectory(vendor)
add_subdirectory(src)
#if (${PROJECT_NAME}_BUILD_EXAMPLES)
# add_subdirectory(examples)
#endif ()
if (${PROJECT_NAME}_BUILD_TESTING)
add_subdirectory(test)
if (${PROJECT_NAME}_COVERAGE)
coverage_evaluate()
endif ()
endif ()