-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
141 lines (99 loc) · 3.53 KB
/
Copy pathCMakeLists.txt
File metadata and controls
141 lines (99 loc) · 3.53 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Minimum cmake verison 3.0 required by the way CMake handles rpath information on Mac OSX.
cmake_minimum_required (VERSION 3.0)
#########
# setup #
#########
cmake_policy( SET CMP0048 NEW ) # version in project()
project( Mantis VERSION 3.3.1 )
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/Scarab/cmake )
include( PackageBuilder )
pbuilder_prepare_project()
include_directories( BEFORE
${PROJECT_SOURCE_DIR}/Common
${PROJECT_SOURCE_DIR}/Client
${PROJECT_SOURCE_DIR}/Server
${PROJECT_BINARY_DIR}/Common
)
##################
# mantis options #
##################
# Option to build the client library and executables
set( Mantis_BUILD_CLIENT TRUE CACHE BOOL "Flag to enable building of the client library and applications" )
# Option to build the server library and executables, and options to build different servers
set( Mantis_BUILD_SERVER TRUE CACHE BOOL "Flag to enable building of the server library and applications" )
# add an option to perform iterator time profiling
set( Mantis_ENABLE_ITERATOR_TIMING FALSE CACHE BOOL "Flag to enable iterator time profiling" )
if( Mantis_ENABLE_ITERATOR_TIMING )
add_definitions( -DENABLE_ITERATOR_TIMING )
else( Mantis_ENABLE_ITERATOR_TIMING )
remove_definitions( -DENABLE_ITERATOR_TIMING )
endif( Mantis_ENABLE_ITERATOR_TIMING )
# add an option to build the validation tests
if (Mantis_ENABLE_TESTING)
enable_testing ()
endif (Mantis_ENABLE_TESTING)
# add an option to build docs
set( Mantis_BUILD_DOCS FALSE CACHE BOOL "Enable make targets for both doxygen and sphinx (requires Doxygen, Sphinx, and Breathe)" )
#######################
# mantis dependencies #
#######################
######
# Git
######
# if git is used, get the commit SHA1
find_package( Git )
if( GIT_FOUND )
execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse -q HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE Mantis_GIT_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE )
execute_process( COMMAND ${GIT_EXECUTABLE} describe --tags --long WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE Mantis_GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE )
endif( GIT_FOUND )
########
# Boost
########
# Boost (1.46 required for filesystem version 3)
find_package( Boost 1.46.0 REQUIRED COMPONENTS atomic filesystem thread date_time )
# make sure dynamic linking is assumed for all boost libraries
add_definitions( -DBOOST_ALL_DYN_LINK )
include_directories( ${Boost_INCLUDE_DIRS} )
pbuilder_add_ext_libraries( ${Boost_LIBRARIES} )
########
# Scarab
########
pbuilder_add_submodule( Scarab Scarab/library )
set( Scarab_BUILD_CODEC_JSON TRUE CACHE BOOL "" FORCE )
set( Scarab_BUILD_CODEC_MSGPACK TRUE CACHE BOOL "" FORCE )
##########
# Monarch
##########
pbuilder_add_submodule( Monarch Monarch )
###########
# libthorax
###########
pbuilder_add_submodule( libthorax libthorax )
###################
# SimpleAmqpClient
###################
pbuilder_add_submodule( SimpleAmqpClient SimpleAmqpClient )
##########
# Threads
##########
find_package( Threads )
pbuilder_add_ext_libraries( ${CMAKE_THREAD_LIBS_INIT} )
#########################
# Winsock (Windows only)
#########################
if( WIN32 )
pbuilder_add_ext_libraries( "Ws2_32" )
endif( WIN32 )
################
# Build Mantis #
################
add_subdirectory( Common )
add_subdirectory( Client )
add_subdirectory( Server )
if( Mantis_ENABLE_EXECUTABLES )
add_subdirectory( Applications )
endif( Mantis_ENABLE_EXECUTABLES )
if( Mantis_BUILD_DOCS )
add_subdirectory( Documentation )
endif( Mantis_BUILD_DOCS )
pbuilder_variables_for_parent()