forked from m-mizutani/dns-gazer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (43 loc) · 1.42 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(dns-gazer)
IF(NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
SET(CMAKE_BUILD_TYPE "Release")
ENDIF()
IF(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
ENDIF()
IF(POLICY CMP0015)
cmake_policy(SET CMP0015 NEW)
ENDIF()
SET(FLUENT_INSTALL OFF)
SET(CMAKE_CXX_FLAGS_RELEASE "-Wall -O3 -std=c++0x")
SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -O0 -std=c++0x -g")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
INCLUDE_DIRECTORIES(${INC_DIR} ./src)
INCLUDE_DIRECTORIES(external/packetmachine/src/)
INCLUDE_DIRECTORIES(external/libfluent/src/)
ADD_SUBDIRECTORY(external/packetmachine)
ADD_SUBDIRECTORY(external/libfluent)
LINK_DIRECTORIES(${LIB_DIR})
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
INCLUDE_DIRECTORIES(/usr/local/include)
LINK_DIRECTORIES(/usr/local/lib)
ENDIF()
# Build library
FILE(GLOB BASESRCS
"src/gazer.cc"
"src/dns.cc" "src/dns.hpp"
"src/utils.cc" "src/utils.hpp"
"src/optparse.cc" "src/optparse.hpp"
"./external/cpp-toolbox/src/buffer.cc"
"./external/cpp-toolbox/src/buffer.hpp"
"./external/cpp-toolbox/src/hash.cc"
"./external/cpp-toolbox/src/hash.hpp"
"./external/cpp-toolbox/src/cache.h"
)
# Application (CLI) code
ADD_EXECUTABLE(dns-gazer ${BASESRCS})
TARGET_LINK_LIBRARIES(dns-gazer pm-static fluent-static)
INSTALL(TARGETS dns-gazer RUNTIME DESTINATION bin)