forked from tumi8/vermont
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
453 lines (371 loc) · 14.9 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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
#
# VERMONT build scripts for CMake
# Copyright (C) 2007 Christoph Sommer <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
PROJECT(VERMONT)
### CMake configuration
# allow building with old CMake. Use some bundled modules as a fallback
CMAKE_MINIMUM_REQUIRED(VERSION 2.3.5)
SET(CMAKE_MODULE_PATH ${CMAKE_ROOT}/Modules ${CMAKE_SOURCE_DIR}/cmake/modules)
# move some config clutter to the advanced section
MARK_AS_ADVANCED(
CMAKE_BACKWARDS_COMPATIBILITY
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX
EXECUTABLE_OUTPUT_PATH
LIBRARY_OUTPUT_PATH
)
### basic modules
SUBDIRS(
src
)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 OLD)
cmake_policy(SET CMP0002 OLD)
endif(COMMAND cmake_policy)
ADD_EXECUTABLE(vermont
src/vermont.cc
)
INCLUDE_DIRECTORIES(${VERMONT_SOURCE_DIR}/src)
TARGET_LINK_LIBRARIES(vermont
modules
core
anon
ipfixlolib
common
osdep
)
INSTALL(TARGETS vermont
RUNTIME DESTINATION bin
)
INSTALL(FILES README LICENSE
DESTINATION share/doc/vermont
)
INSTALL(FILES ipfix-config-schema.xsd
DESTINATION share/vermont
)
INSTALL(DIRECTORY configs/
DESTINATION share/vermont/configs
PATTERN ".svn" EXCLUDE
)
### doxygen
#FIND_PACKAGE(Doxygen REQUIRED)
### threads
FIND_PACKAGE(Threads REQUIRED)
TARGET_LINK_LIBRARIES(vermont
${CMAKE_THREAD_LIBS_INIT}
)
### boost
FIND_PACKAGE(Boost REQUIRED)
MARK_AS_ADVANCED(
Boost_INCLUDE_DIR
Boost_REGEX_LIBRARY
Boost_FILESYSTEM_LIBRARY
Boost_UNIT_TEST_FRAMEWORK_LIBRARY
)
IF (Boost_FOUND)
MESSAGE(STATUS "Found boost libraries")
ADD_DEFINITIONS(-DHAVE_BOOST_FILESYSTEM)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
FIND_LIBRARY(Boost_REGEX_LIBRARY NAMES boost_regex-mt boost_regex PATHS ${Boost_LIBRARY_DIRS})
IF (NOT Boost_REGEX_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find boost regex library")
ENDIF(NOT Boost_REGEX_LIBRARY)
FIND_LIBRARY(Boost_FILESYSTEM_LIBRARY NAMES boost_filesystem-mt boost_filesystem PATHS ${Boost_LIBRARY_DIRS})
IF (NOT Boost_FILESYSTEM_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find boost filesystem library")
ENDIF(NOT Boost_FILESYSTEM_LIBRARY)
FIND_LIBRARY(Boost_UNIT_TEST_FRAMEWORK_LIBRARY NAMES boost_unit_test_framework-mt boost_unit_test_framework PATHS ${Boost_LIBRARY_DIRS})
IF (NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find boost unit test framework")
ENDIF (NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY)
FIND_LIBRARY(Boost_SYSTEM_LIBRARY NAMES boost_system-mt boost_system PATHS ${Boost_LIBRARY_DIRS})
IF (NOT Boost_SYSTEM_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find boost system library")
ENDIF (NOT Boost_SYSTEM_LIBRARY)
TARGET_LINK_LIBRARIES(vermont
${Boost_REGEX_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
)
ELSE (Boost_FOUND)
MESSAGE(FATAL_ERROR "Could not find boost libraries")
REMOVE_DEFINITIONS(-DHAVE_BOOST_FILESYSTEM)
ENDIF (Boost_FOUND)
### libxml2
FIND_PACKAGE(LibXml2 REQUIRED)
MARK_AS_ADVANCED(
LIBXML2_INCLUDE_DIR
LIBXML2_LIBRARIES
)
IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
MESSAGE(STATUS "Found libxml2 libraries")
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(vermont
${LIBXML2_LIBRARIES}
)
ELSE (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
MESSAGE(FATAL_ERROR "Could not find libxml2 libraries")
ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
### debug
OPTION(DEBUG "Enable debug code. Vermont will run significantly slower if enabled." OFF)
IF (DEBUG)
message(STATUS "Configuring build process for debug version")
REMOVE_DEFINITIONS(-O3)
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
### FreeBSDs compilers have problems if profiling is enabled and exceptions are used
### with 8-STABLE and 7-STABLE (as of June 21th 2010). Some exceptions will not be
### caugth if -pg is given at compile time. We therefore disable profiling for FreeBSD
MESSAGE(STATUS "Detected a FreeBSD system. Not including profiling support in DEBUG mode")
ADD_DEFINITIONS(-O0 -g -Wall -DDEBUG)
SET_TARGET_PROPERTIES(vermont PROPERTIES LINK_FLAGS "-g")
ELSE (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
ADD_DEFINITIONS(-O0 -g -pg -Wall -DDEBUG)
SET_TARGET_PROPERTIES(vermont PROPERTIES LINK_FLAGS "-g -pg")
ENDIF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
ELSE (DEBUG)
REMOVE_DEFINITIONS(-O0 -g -pg -Wall -Werror -DDEBUG)
ADD_DEFINITIONS(-O3)
SET_TARGET_PROPERTIES(vermont PROPERTIES LINK_FLAGS "")
ENDIF (DEBUG)
### IP_HEADER_OFFSET
SET(IP_HEADER_OFFSET 14 CACHE STRING "Start position of the IP header in an ethernet frame in Bytes. This value needs to be adjusted according to the network monitored. The default value is 14 for ethernet devices. Other common values are 4 (BSD loop back device) and 18 (Ethernet VLAN)")
ADD_DEFINITIONS(-DIP_HEADER_OFFSET=${IP_HEADER_OFFSET})
### PCAP_MAX_CAPTURE_LENGTH
SET(PCAP_MAX_CAPTURE_LENGTH 128 CACHE STRING "Maximum PCAP packet capture length (this amount of bytes is always allocated for each packet, the smaller the better!)")
ADD_DEFINITIONS(-DPCAP_MAX_CAPTURE_LENGTH=${PCAP_MAX_CAPTURE_LENGTH})
# TODO: there is a bug in the code that occurs then the MAX_CAPTURE_LENGTH is > 65000
# that occurs in the offset calucation in PacketHashTable (the offset is a uint16_t that
# overflows when MAX_CAPTURE_LENGTH is too big.
# until we fixted the bug, we restrict ourselfs on on teh maximum capture length
IF (PCAP_MAX_CAPTURE_LENGTH GREATER 65000)
MESSAGE(FATAL_ERROR "PCAP_MAX_CAPTURE_LENGTH is too big. Make it <= 65000 or fix the bug described in CMakeLists.txt")
ENDIF(PCAP_MAX_CAPTURE_LENGTH GREATER 65000)
### PCAP_DEFAULT_CAPTURE_LENGTH
SET(PCAP_DEFAULT_CAPTURE_LENGTH 128 CACHE STRING "Default PCAP packet capture length (default value for PCAP snaplen if not defined in configuration)")
ADD_DEFINITIONS(-DPCAP_DEFAULT_CAPTURE_LENGTH=${PCAP_DEFAULT_CAPTURE_LENGTH})
### SUPPORT_NETFLOWV9
OPTION(SUPPORT_NETFLOWV9 "Enable NetFlow version 9 support" ON)
IF (SUPPORT_NETFLOWV9)
ADD_DEFINITIONS(-DSUPPORT_NETFLOWV9)
ELSE (SUPPORT_NETFLOWV9)
REMOVE_DEFINITIONS(-DSUPPORT_NETFLOWV9)
ENDIF (SUPPORT_NETFLOWV9)
### MySQL
OPTION(SUPPORT_MYSQL "Enable dbwriter/dbreader support" OFF)
IF (SUPPORT_MYSQL)
FIND_PACKAGE(MySQL REQUIRED)
MARK_AS_ADVANCED(
MYSQL_ADD_INCLUDE_DIR
MYSQL_ADD_LIBRARY
MYSQL_CONFIG
MYSQL_CONFIG_PREFER_PATH
)
IF (NOT MYSQL_FOUND)
MESSAGE(FATAL_ERROR "Could not find MySQL libraries.")
ENDIF (NOT MYSQL_FOUND)
ENDIF (SUPPORT_MYSQL)
IF (MYSQL_FOUND AND SUPPORT_MYSQL)
MESSAGE(STATUS "Found MySQL libraries")
ADD_DEFINITIONS(-DDB_SUPPORT_ENABLED)
INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(vermont
${MYSQL_LIBRARIES}
)
ELSE (MYSQL_FOUND AND SUPPORT_MYSQL)
REMOVE_DEFINITIONS(-DDB_SUPPORT_ENABLED)
ENDIF (MYSQL_FOUND AND SUPPORT_MYSQL)
### PostgreSQL
OPTION(SUPPORT_PGSQL "Enable PostgreSQL support" OFF)
IF (SUPPORT_PGSQL)
FIND_PACKAGE(PostgreSQL REQUIRED)
IF (NOT POSTGRESQL_FOUND)
MESSAGE(FATAL_ERROR "Could not find PostgreSQL libraries.")
ENDIF (NOT POSTGRESQL_FOUND)
ENDIF (SUPPORT_PGSQL)
IF (POSTGRESQL_FOUND)
MESSAGE(STATUS "Found PostgreSQL libraries")
ADD_DEFINITIONS(-DPG_SUPPORT_ENABLED)
INCLUDE_DIRECTORIES(${POSTGRESQL_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(vermont
${POSTGRESQL_LIBRARIES}
)
ELSE (POSTGRESQL_FOUND)
REMOVE_DEFINITIONS(-DPG_SUPPORT_ENABLED)
ENDIF (POSTGRESQL_FOUND)
### libpcap-mmap
OPTION(USE_PCAPMMAP "Use libpcap-mmap." OFF)
MARK_AS_ADVANCED(
PCAP_LIBRARY_REGULAR
PCAP_LIBRARY_MMAP
PCAP_INCLUDE_PATH
)
OPTION(USE_PFRING "Use pf_ring optimized libpcap." OFF)
MARK_AS_ADVANCED(
PCAP_LIBRARY_PFRING
PFRING_LIBRARY
)
IF (USE_PCAPMMAP)
IF (USE_PFRING)
MESSAGE(FATAL_ERROR "Both USE_PCAPMMAP and USE_PFRING have been selected. At most one of these options may be selected!")
ENDIF (USE_PFRING)
FIND_LIBRARY(PCAP_LIBRARY_MMAP NAMES pcap pcap-mmap PATHS ${VERMONT_SOURCE_DIR} ${VERMONT_SOURCE_DIR}/libpcap-mmap ${VERMONT_SOURCE_DIR}/../libpcap-mmap ${VERMONT_SOURCE_DIR}/../../../trunk/libpcap-mmap NO_DEFAULT_PATH)
FIND_PATH(PCAP_INCLUDE_PATH NAMES pcap.h PATHS ${VERMONT_SOURCE_DIR} ${VERMONT_SOURCE_DIR}/libpcap-mmap ${VERMONT_SOURCE_DIR}/../libpcap-mmap ${VERMONT_SOURCE_DIR}/../../../trunk/libpcap-mmap NO_DEFAULT_PATH)
SET(PCAP_LIBRARY "${PCAP_LIBRARY_MMAP}")
IF (PCAP_LIBRARY_MMAP)
SET(PCAP_LIBRARY "${PCAP_LIBRARY_MMAP}")
INCLUDE_DIRECTORIES(${PCAP_INCLUDE_PATH})
ELSE (PCAP_LIBRARY_MMAP)
MESSAGE(FATAL_ERROR "Could not find libpcap-mmap. This script also looks in directory ./libpcap-mmap, so maybe you want to create a symlink to the directory of the library.")
ENDIF (PCAP_LIBRARY_MMAP)
TARGET_LINK_LIBRARIES(vermont ${PCAP_LIBRARY})
ELSEIF (USE_PFRING)
FIND_LIBRARY(PCAP_LIBRARY_PFRING NAMES pcap PATHS ${VERMONT_SOURCE_DIR} ${VERMONT_SOURCE_DIR}/PF_RING/userland/libpcap-1.0.0-ring ${VERMONT_SOURCE_DIR}/../PF_RING/userland/libpcap-1.0.0-ring NO_DEFAULT_PATH)
IF (NOT PCAP_LIBRARY_PFRING)
MESSAGE(FATAL_ERROR "Could not find libpcap-ring. This script looks in directories ${VERMONT_SOURCE_DIR}/PF_RING/userland/libpcap-1.0.0-ring and ${VERMONT_SOURCE_DIR}/../PF_RING/userland/libpcap-1.0.0-ring, so maybe you want to create a symlink to the directory of the library.")
ENDIF (NOT PCAP_LIBRARY_PFRING)
FIND_LIBRARY(PFRING_LIBRARY NAMES pfring PATHS ${VERMONT_SOURCE_DIR} ${VERMONT_SOURCE_DIR}/PF_RING/userland/lib ${VERMONT_SOURCE_DIR}/../PF_RING/userland/lib NO_DEFAULT_PATH)
IF (NOT PFRING_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find libpfring. This script looks in directories ${VERMONT_SOURCE_DIR}/PF_RING/userland/lib and ${VERMONT_SOURCE_DIR}/../PF_RING/userland/lib, so maybe you want to create a symlink to the directory of the library.")
ENDIF (NOT PFRING_LIBRARY)
FIND_PATH(PCAP_INCLUDE_PATH NAMES pcap.h PATHS ${VERMONT_SOURCE_DIR} ${VERMONT_SOURCE_DIR}/PF_RING/userland/libpcap-1.0.0-ring ${VERMONT_SOURCE_DIR}/../PF_RING/userland/libpcap-1.0.0-ring NO_DEFAULT_PATH)
TARGET_LINK_LIBRARIES(vermont ${PCAP_LIBRARY_PFRING})
TARGET_LINK_LIBRARIES(vermont ${PFRING_LIBRARY})
INCLUDE_DIRECTORIES(${PCAP_INCLUDE_PATH})
ELSE (USE_PCAPMMAP)
FIND_LIBRARY(PCAP_LIBRARY_REGULAR NAMES pcap)
IF (PCAP_LIBRARY_REGULAR)
SET(PCAP_LIBRARY "${PCAP_LIBRARY_REGULAR}")
ELSE (PCAP_LIBRARY_REGULAR)
MESSAGE(FATAL_ERROR "Could not find libpcap")
ENDIF (PCAP_LIBRARY_REGULAR)
TARGET_LINK_LIBRARIES(vermont ${PCAP_LIBRARY})
ENDIF (USE_PCAPMMAP)
IF (USE_PFRING)
ELSE (USE_PFRING)
FIND_LIBRARY(PCAP_LIBRARY_REGULAR NAMES pcap)
IF (PCAP_LIBRARY_REGULAR)
TARGET_LINK_LIBRARIES(vermont ${PCAP_LIBRARY_REGULAR})
ELSE (PCAP_LIBRARY_REGULAR)
MESSAGE(FATAL_ERROR "Could not find libpcap.")
ENDIF (PCAP_LIBRARY_REGULAR)
ENDIF (USE_PFRING)
### sctp
OPTION(SUPPORT_SCTP "Support SCTP transport protocol" ON)
IF (SUPPORT_SCTP)
FIND_PACKAGE(Sctp REQUIRED)
MARK_AS_ADVANCED(
SCTP_LIBRARIES
SCTP_INCLUDE_DIR
)
ADD_DEFINITIONS(-DSUPPORT_SCTP)
ELSE (SUPPORT_SCTP)
REMOVE_DEFINITIONS(-DSUPPORT_SCTP)
ENDIF (SUPPORT_SCTP)
### connection filter
OPTION(CONNECTION_FILTER "Enables/disables the connection filter." OFF)
OPTION(USE_GSL "Enables/disables GSL in connectionflter." ON)
IF (CONNECTION_FILTER AND NOT USE_GSL)
MESSAGE(FATAL_ERROR "GSL is needed for Connectionfilter at the moment.
You cannot have -DCONNECTION_FILTER=ON and -DUSE_GSL=OFF")
ENDIF (CONNECTION_FILTER AND NOT USE_GSL)
IF (CONNECTION_FILTER)
### gsl
IF (USE_GSL)
FIND_PACKAGE(GSL)
MARK_AS_ADVANCED(
GSL_INCLUDE_DIR
GSL_LIBRARIES
GSL_LIBRARY
BLAS_LIBRARY
)
IF (GSL_FOUND)
MESSAGE(STATUS "GNU scientific library found")
ELSE (GSL_FOUND)
MESSAGE(FATAL_ERROR "GNU scientific library not found. Please
install the library or use -DCONNECTION_FILTER=OFF and -DUSE_GSL=OFF")
ENDIF (GSL_FOUND)
ADD_DEFINITIONS(-DHAVE_GSL)
TARGET_LINK_LIBRARIES(vermont ${GSL_LIBRARIES})
ENDIF (USE_GSL)
ADD_DEFINITIONS(-DHAVE_CONNECTION_FILTER)
ENDIF(CONNECTION_FILTER)
### openssl
OPTION(SUPPORT_DTLS "Enables/Disables encryption support for IPFIX messages." OFF)
IF (SUPPORT_DTLS)
FIND_PACKAGE(OpenSSL)
IF (NOT OPENSSL_FOUND)
MESSAGE(FATAL_ERROR "Could not find openssl. Please install the library or turn off SUPPORT_DTLS")
ENDIF (NOT OPENSSL_FOUND)
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(vermont ${OPENSSL_LIBRARIES})
ADD_DEFINITIONS(-DSUPPORT_DTLS)
## check wether there is a libcrypto
# FIND_PACKAGE(Crypto)
# IF (CRYPTO_FOUND)
# TARGET_LINK_LIBRARIES(vermont ${CRYPTO_LIBRARIES})
# ENDIF (CRYPTO_FOUND)
ELSE(SUPPORT_DTLS)
REMOVE_DEFINITIONS(-DSUPPORT_DLTS)
ENDIF(SUPPORT_DTLS)
OPTION(SUPPORT_DTLS_OVER_SCTP "Enables/Disables DTLS on SCTP streams." OFF)
IF (SUPPORT_DTLS_OVER_SCTP)
IF (SUPPORT_SCTP AND SUPPORT_DTLS)
# Make sure OpenSSL was compiled with SCTP support enabled
INCLUDE(CheckSymbolExists)
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
# OpenSSL #defines OPENSSL_SCTP if it supports SCTP
CHECK_SYMBOL_EXISTS(OPENSSL_SCTP "openssl/ssl.h" OPENSSL_SUPPORTS_SCTP)
SET(CMAKE_REQUIRED_INCLUDES)
IF (NOT OPENSSL_SUPPORTS_SCTP)
MESSAGE(FATAL_ERROR "OpenSSL built without SCTP support. Rebuild OpenSSL with SCTP support or turn off SUPPORT_DTLS_OVER_SCTP")
ENDIF (NOT OPENSSL_SUPPORTS_SCTP)
ADD_DEFINITIONS(-DSUPPORT_DTLS_OVER_SCTP)
ELSE (SUPPORT_SCTP AND SUPPORT_DTLS)
MESSAGE(FATAL_ERROR "SUPPORT_DTLS_OVER_SCTP can only be enabled together with SUPPORT_SCTP and SUPPORT_DTLS")
REMOVE_DEFINITIONS(-DSUPPORT_DTLS_OVER_SCTP)
ENDIF(SUPPORT_SCTP AND SUPPORT_DTLS)
ELSE (SUPPORT_DTLS_OVER_SCTP)
REMOVE_DEFINITIONS(-DSUPPORT_DTLS_OVER_SCTP)
ENDIF (SUPPORT_DTLS_OVER_SCTP)
### tools
OPTION(WITH_TOOLS "Build misc tools." ON)
IF (WITH_TOOLS)
SUBDIRS(tools)
SUBDIR_DEPENDS(tools src)
ELSE (WITH_TOOLS)
ENDIF (WITH_TOOLS)
### tests
OPTION(WITH_TESTS "Build unit tests." OFF)
IF (WITH_TESTS)
SUBDIRS(src/tests)
ELSE (WITH_TESTS)
ENDIF (WITH_TESTS)
OPTION(DISABLE_MEMMANAGER "Disable custom memory manager (good for finding leaks with valgrind." OFF)
IF (DISABLE_MEMMANAGER)
if (NOT DEBUG)
MESSAGE(FATAL_ERROR "Flag DISABLE_MEMMANAGER may only be set if flag DEBUG is set")
ENDIF (NOT DEBUG)
ADD_DEFINITIONS(-DIM_DISABLE)
ENDIF (DISABLE_MEMMANAGER)
### IPFIXLOLIB_RAWDIR_SUPPORT
OPTION(IPFIXLOLIB_RAWDIR_SUPPORT "Enable ipfix rawdir support" OFF)
IF (IPFIXLOLIB_RAWDIR_SUPPORT)
ADD_DEFINITIONS(-DIPFIXLOLIB_RAWDIR_SUPPORT)
ELSE (IPFIXLOLIB_RAWDIR_SUPPORT)
REMOVE_DEFINITIONS(-DIPFIXLOLIB_RAWDIR_SUPPORT)
ENDIF (IPFIXLOLIB_RAWDIR_SUPPORT)