-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
60 lines (48 loc) · 1.92 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
cmake_minimum_required (VERSION 2.8)
project(reass)
enable_testing()
#set(Boost_INCLUDE_DIRS "/usr/include") # specify directory containing the "boost" subdirectory
if (NOT Boost_INCLUDE_DIRS)
find_package(Boost REQUIRED COMPONENTS unit_test_framework system filesystem)
if (NOT Boost_FOUND OR Boost_VERSION EQUAL 104800)
message("Boost NOT found (or boost 1.48 found, which is unusable)")
message(FATAL_ERROR "Please update the top CMakeLists.txt and specify your boost path in Boost_INCLUDE_DIRS")
endif()
endif()
IF(NOT DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
ENDIF()
add_definitions(-Wall)
#add_definitions(-std=gnu++0x)
add_definitions(-DBOOST_TEST_DYN_LINK)
add_definitions(-march=native)
if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb3")
endif()
if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG")
#message("Building reass with debug libstdc++, make sure to define -D_GLIBCXX_DEBUG when using this library this way")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
endif()
include_directories(.)
include_directories(${Boost_INCLUDE_DIRS})
subdirs(lib)
subdirs(demo)
subdirs(testcases)
SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
SET(CPACK_RESOURCE_FILE_LICENSE "LICENSE")
SET(CPACK_RESOURCE_FILE_README "README")
SET(CPACK_GENERATOR "TGZ;DEB")
SET(CPACK_PACKAGE_CONTACT https://github.com/weary)
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpcap-dev")
# extract version number from git.
# note that this only runs during configure
execute_process(
COMMAND git describe
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE CPACK_PACKAGE_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
include(CPack)