-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (76 loc) · 3.86 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
project (Dionysus)
cmake_minimum_required (VERSION 2.4)
option (logging "Build Dionysus with logging on" OFF)
option (counters "Build Dionysus with counters on" OFF)
option (debug "Build Dionysus with debugging on" OFF)
option (optimize "Build Dionysus with optimization" ON)
option (use_cgal "Build examples and python bindings that use CGAL" ON)
option (use_dsrpdb "Build examples that use DSR-PDB" OFF)
option (use_synaps "Build examples that use SYNAPS" OFF)
# Find everything that's always required
find_package (Boost COMPONENTS program_options python3 serialization signals REQUIRED)
find_package (Doxygen)
if (use_dsrpdb)
find_library (dsrpdb_LIBRARY NAMES dsrpdb)
find_path (dsrpdb_INCLUDE_DIR dsrpdb/Protein.h)
endif (use_dsrpdb)
# CGAL
if (use_cgal)
find_package (CGAL QUIET)
endif (use_cgal)
#add_definitions (-DCGAL_NO_ASSERTIONS -DCGAL_NO_PRECONDITIONS)
# SYNAPS
if (use_synaps)
add_definitions (-DBOOST_UBLAS_TYPE_CHECK=0)
find_library (synaps_LIBRARY NAMES synaps)
set (synaps_libraries ${synaps_LIBRARY}
${gmp_LIBRARY}
${gmpxx_LIBRARY})
endif (use_synaps)
# Debugging
if (debug)
if (optimize)
set (cxx_flags ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
else (optimize)
set (cxx_flags ${CMAKE_CXX_FLAGS_DEBUG})
endif (optimize)
else (debug)
if (optimize)
set (cxx_flags ${CMAKE_CXX_FLAGS_RELEASE})
else (optimize)
set (cxx_flags ${CMAKE_CXX_FLAGS})
endif (optimize)
endif (debug)
add_definitions (${cxx_flags})
# Fix the XCode bug
add_definitions (-ftemplate-depth=256)
# Logging
if (logging)
find_library (rlog_LIBRARY NAMES rlog)
find_path (rlog_INCLUDE_DIR rlog/rlog.h)
set (rlog_INCLUDE_DIR ${rlog_INCLUDE_DIR})
add_definitions (-DLOGGING -DRLOG_COMPONENT=dionysus)
set (libraries ${libraries} ${rlog_LIBRARY})
endif (logging)
# Counters
if (counters)
add_definitions (-DCOUNTERS)
endif (counters)
# Set includes
include_directories (${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${Boost_INCLUDE_DIR}
${dsrpdb_INCLUDE_DIR}
${cwd_INCLUDE_DIR}
${rlog_INCLUDE_DIR})
# Doxygen (FIXME)
if (DOXYGEN_FOUND)
# add_custom_target (docs ALL
# ${DOXYGEN_EXECUTABLE} Doxyfile
# DEPENDS Doxyfile)
endif (DOXYGEN_FOUND)
# Process subdirectories
add_subdirectory (examples)
add_subdirectory (tests)
add_subdirectory (tools)
add_subdirectory (bindings)