-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
36 lines (29 loc) · 1.3 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
cmake_minimum_required(VERSION 3.9)
project(dstar)
include(ExternalProject)
set(CMAKE_CXX_STANDARD 11)
# ARGSX LIBRARY
set(DEP_ARGSX "argsx")
set(LIB_ARGSX "ArgsX.a")
# SPARK LIBRARY
set(DEP_SPARK "spark")
set(LIB_SPARK "Spark.a")
# ARGSX LIBRARY
ExternalProject_Add(${DEP_ARGSX} PREFIX "${PROJECT_SOURCE_DIR}/lib/argsx/" SOURCE_DIR "${PROJECT_SOURCE_DIR}/lib/argsx/" INSTALL_COMMAND "")
ExternalProject_Get_Property(${DEP_ARGSX} source_dir)
include_directories("${source_dir}/include/")
link_directories("${source_dir}/bin/")
# SPARK LIBRARY
ExternalProject_Add(${DEP_SPARK} PREFIX "${PROJECT_SOURCE_DIR}/lib/spark/" SOURCE_DIR "${PROJECT_SOURCE_DIR}/lib/spark/" INSTALL_COMMAND "")
ExternalProject_Get_Property(${DEP_SPARK} source_dir)
include_directories("${source_dir}/include/")
link_directories("${source_dir}/bin/")
include_directories(include)
set(EXECUTABLE_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/bin")
add_executable(dstar src/main.cpp src/Core.cpp src/actions/Flood.cpp src/actions/Starvation.cpp src/DhcpPool.cpp include/DhcpPool.h src/DhcpSocket.cpp include/DhcpSocket.h include/Options.h)
add_dependencies(dstar ${DEP_ARGSX})
add_dependencies(dstar ${DEP_SPARK})
target_link_libraries(dstar pthread)
target_link_libraries(dstar rt)
target_link_libraries(dstar ${LIB_ARGSX})
target_link_libraries(dstar ${LIB_SPARK})