-
Notifications
You must be signed in to change notification settings - Fork 20
/
CMakeLists.txt
48 lines (38 loc) · 1.27 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
CMAKE_MINIMUM_REQUIRED( VERSION 3.0 )
PROJECT( flexcore )
IF( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
SET( STANDALONE TRUE )
ELSE()
SET( STANDALONE FALSE )
ENDIF()
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
OPTION( FLEXCORE_ENABLE_COVERAGE_ANALYSIS "activate gcov based coverage anlysis" OFF )
OPTION( FLEXCORE_ENABLE_TESTS "build unit tests" ${STANDALONE} )
OPTION( FLEXCORE_ENABLE_BENCHMARKS "build micro benchmarks" OFF )
IF( FLEXCORE_ENABLE_COVERAGE_ANALYSIS AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
MESSAGE( WARNING "Build type is not Debug, code coverage information may be wrong" )
ENDIF()
ADD_COMPILE_OPTIONS(
"-Wall"
"-Wextra"
"-pedantic"
$<$<BOOL:${FLEXCORE_ENABLE_COVERAGE_ANALYSIS}>:-fprofile-arcs>
$<$<BOOL:${FLEXCORE_ENABLE_COVERAGE_ANALYSIS}>:-ftest-coverage>
)
IF( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
ADD_COMPILE_OPTIONS(
"-Wno-unused-local-typedef"
)
ENDIF()
SET(THREADS_PREFER_PTHREAD_FLAG ON)
FIND_PACKAGE( Boost 1.55 REQUIRED COMPONENTS log)
FIND_PACKAGE( Threads )
ADD_SUBDIRECTORY( flexcore )
ADD_SUBDIRECTORY( docs )
IF( FLEXCORE_ENABLE_TESTS )
ADD_SUBDIRECTORY( tests )
ADD_SUBDIRECTORY( integration_tests )
ENDIF()
IF ( FLEXCORE_ENABLE_BENCHMARKS )
ADD_SUBDIRECTORY( benchmarks )
ENDIF()