-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
66 lines (54 loc) · 1.69 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
60
61
62
63
64
65
66
PROJECT(APTO CXX)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
# Default location for installed software/configs/ docs is the build directory.
SET(CMAKE_INSTALL_PREFIX
"${PROJECT_BINARY_DIR}"
CACHE PATH
"Install path prefix, prepended onto install directories."
FORCE
)
# Final software is built directly into the work subdirectory.
SET(EXECUTABLE_OUTPUT_PATH
"${PROJECT_BINARY_DIR}/bin"
CACHE PATH
"Single output directory for building all executables."
)
SET(LIBRARY_OUTPUT_PATH
"${PROJECT_BINARY_DIR}/lib"
CACHE PATH
"Built libraries are placed here before installation."
)
IF(UNIX)
SET(CMAKE_CXX_FLAGS_DEBUG
"-g -DDEBUG"
CACHE STRING "Flags used by the compiler during debug builds." FORCE)
SET(CMAKE_CXX_FLAGS_MINSIZEREL
"-Os -DNDEBUG"
CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-O3 -g -DDEBUG"
CACHE STRING "Flags used by the compiler during release builds." FORCE)
SET(CMAKE_CXX_FLAGS_RELEASE
"-O3 -DNDEBUG"
CACHE STRING "Flags used by the compiler during release builds." FORCE)
ENDIF(UNIX)
# Default build mode compiles c++ and c code with debug info and no
# optimizations.
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE
Release
CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE
)
ENDIF(NOT CMAKE_BUILD_TYPE)
ADD_SUBDIRECTORY(src)
INSTALL(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h")
OPTION(APTO_UNIT_TESTS
"Enable the unit-tests executable"
ON
)
IF(APTO_UNIT_TESTS)
ADD_SUBDIRECTORY(utils/unittest/googletest)
ADD_SUBDIRECTORY(unittests)
ENDIF(APTO_UNIT_TESTS)