-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·42 lines (29 loc) · 1.42 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
# Copyright Marek Dalewski 2017
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
##### Initialization -----------------------------------------------------------
# Required version
cmake_minimum_required(VERSION 3.1)
##### Utilities ----------------------------------------------------------------
# Set default build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used), Debug, Release, RelWithDebInfo, MinSizeRel." FORCE)
else()
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used), Debug, Release, RelWithDebInfo, MinSizeRel.")
endif()
# Allow easy adding flags, based on build type
function(build_type_compose out global debug release relwithdebinfo minsizerel)
set(
${out}
${global}
$<$<CONFIG:Debug>:${debug}>
$<$<CONFIG:Release>:${release}>
$<$<CONFIG:RelWithDebInfo>:${relwithdebinfo}>
$<$<CONFIG:MinSizeRel>:${minsizerel}>
PARENT_SCOPE
)
endfunction()
##### Project ------------------------------------------------------------------
# Include project main CMake file
include(project/root.cmake)