-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
53 lines (42 loc) · 1.68 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(Punisher)
# import libraries
IF (NOT TARGET Event)
ADD_SUBDIRECTORY(externals/Event ${CMAKE_CURRENT_BINARY_DIR}/Event)
ENDIF (NOT TARGET Event)
IF (NOT TARGET Logging)
ADD_SUBDIRECTORY(externals/Logging ${CMAKE_CURRENT_BINARY_DIR}/Logging)
ENDIF (NOT TARGET Logging)
IF (NOT TARGET Network)
ADD_SUBDIRECTORY(externals/Network ${CMAKE_CURRENT_BINARY_DIR}/Network)
ENDIF (NOT TARGET Network)
IF (NOT TARGET M)
ADD_SUBDIRECTORY(externals/M ${CMAKE_CURRENT_BINARY_DIR}/M)
ENDIF (NOT TARGET M)
# punisher sources
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(test)
# includes
INCLUDE_DIRECTORIES(externals/Network/include)
INCLUDE_DIRECTORIES(externals/Logging/include)
INCLUDE_DIRECTORIES(externals/Event/include)
INCLUDE_DIRECTORIES(externals/M/include)
INCLUDE_DIRECTORIES(include)
# apple fixes
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
INCLUDE_DIRECTORIES(/opt/local/include)
LINK_DIRECTORIES(/opt/local/lib)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# CFLAGS
#ADD_DEFINITIONS(-DDEBUG -O0 -Wall -g3 -Wextra -Werror -Wfatal-errors)
ADD_DEFINITIONS(-O2 -Wall -Wextra -Werror -Wfatal-errors)
INCLUDE(${Punisher_SOURCE_DIR}/src/SourceFiles.txt)
INCLUDE(${Punisher_SOURCE_DIR}/test/SourceFiles.txt)
# build executables
ADD_EXECUTABLE(Punisher ${Punisher_SRC} ${Punisher_MAIN})
ADD_EXECUTABLE(statstest ${Punisher_SRC} ${Punisher_STATSTEST})
ADD_EXECUTABLE(timetest ${Punisher_SRC} ${Punisher_TIMETEST})
# link executable to necesary libs
TARGET_LINK_LIBRARIES(Punisher Network Event Logging M yaml pthread crypto)
TARGET_LINK_LIBRARIES(statstest Network Event Logging M yaml pthread crypto)
TARGET_LINK_LIBRARIES(timetest Network Event Logging M yaml pthread crypto)