-
Notifications
You must be signed in to change notification settings - Fork 31
/
CMakeLists.txt
65 lines (53 loc) · 2.84 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
project (Dionysus)
cmake_minimum_required (VERSION 3.1)
# Default to Release
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif (NOT CMAKE_BUILD_TYPE)
option (trace "Build Dionysus with trace logging" OFF)
option (counters "Build Dionysus with counters" OFF)
option (debug_zigzag "Turn on debug routines for zigzags" OFF)
option (build_examples "Build examples" ON)
option (build_python_bindings "Build Python bindings" ON)
mark_as_advanced (debug_zigzag)
find_package (Boost)
# Debugging
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR
${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
add_definitions (-DDEBUG)
endif ()
set (CMAKE_CXX_STANDARD 14)
if (counters)
add_definitions (-DCOUNTERS)
endif (counters)
# Logging
if (trace)
add_definitions (-DTRACE)
endif (trace)
if (debug_zigzag)
add_definitions (-DDIONYSUS_ZIGZAG_DEBUG)
endif (debug_zigzag)
# Set includes
set (CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem")
include_directories (${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
SYSTEM ${Boost_INCLUDE_DIR})
# backward.cpp
if (debug)
find_library (LIBDW_LIBRARY NAMES dw)
if (LIBDW_LIBRARY)
set (DEBUG_SOURCES ${CMAKE_SOURCE_DIR}/src/backward.cpp)
add_definitions (-DBACKWARD_HAS_DW=1)
set (libraries ${libraries} ${LIBDW_LIBRARY})
else (LIBDW_LIBRARY)
message (STATUS "LibDW not found; backward.cpp won't be used")
endif (LIBDW_LIBRARY)
endif (debug)
if (build_examples)
add_subdirectory (examples)
endif (build_examples)
if (build_python_bindings)
add_subdirectory (bindings/python)
endif (build_python_bindings)