-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (44 loc) · 1.94 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
cmake_minimum_required(VERSION 3.13)
################################################################################
## PROJECT
## name and version
################################################################################
project(Frame LANGUAGES CXX)
################################################################################
## SETTINGS
## basic project settings before use
################################################################################
# If this project is used as a submodule, the variable should be overridden
# to "OFF" in the top-level application (to disable forced cache rewriting)
option(${PARENT}_SUBMODULE_CACHE_OVERWRITE "Enable forced cache rewriting" ON)
if (${PARENT}_SUBMODULE_CACHE_OVERWRITE)
SET(REWRITE_FORCE "FORCE")
else()
SET(REWRITE_FORCE "")
endif()
# Set default Release mode if not specified
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type defaulting to Release" FORCE)
endif()
################################################################################
## CONFIGURATION
## project configuration
################################################################################
SET(${PARENT}_FRAME ON CACHE BOOL "" ${REWRITE_FORCE})
if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
SET(${PARENT}_FRAME_TEST OFF CACHE BOOL "" ${REWRITE_FORCE})
message("${PROJECT_NAME} included as subrepository.")
else()
SET(${PARENT}_FRAME_TEST ON CACHE BOOL "" ${REWRITE_FORCE})
message("${PROJECT_NAME} is a standalone project.")
endif()
################################################################################
## INCLUDING SUBDIRECTORIES
## Adding subdirectories according to the configuration
################################################################################
if (${PARENT}_FRAME)
add_subdirectory(src)
endif()
if (${PARENT}_FRAME_TEST)
add_subdirectory(test)
endif()