-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
66 lines (55 loc) · 1.66 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
# Set the minimum version of CMake that can be used
# To find the cmake version run
# $ cmake --version
cmake_minimum_required(VERSION 3.5)
# set name of Project
set(EXECUTABLE_NAME zroxy)
# Set the project name
project (${EXECUTABLE_NAME} C)
# Platform-specific configurations
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(STATUS "Configuring for Linux")
add_definitions(-D__linux__)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
message(STATUS "Configuring for FreeBSD")
# add_definitions(-D__FreeBSD__)
endif()
# check for pthread library
find_package(Threads REQUIRED)
# Create a sources variable with a link to all cpp files to compile
set(SOURCES
src/main.c
src/args.c
sniproxy/sniproxy.c
sniproxy/sniclient.c
log/loglock.c
log/log.c
network/net.c
network/socks/socks.c
sniproxy/filter/filter.c
statistics/monitor.c
statistics/statistics.c
dnsproxy/dnsserver.c
dnsproxy/dnsproxy.c
dnsproxy/dns.c
fifo/fifo.c
)
# Add an executable
add_executable(${EXECUTABLE_NAME} ${SOURCES})
# Set the directories that should be included in the build command for this target
# when running g++ these will be included as -I/directory/path/
target_include_directories(${EXECUTABLE_NAME}
PRIVATE
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/log
${PROJECT_SOURCE_DIR}/sniproxy
${PROJECT_SOURCE_DIR}/dnsproxy
${PROJECT_SOURCE_DIR}/statistics
${PROJECT_SOURCE_DIR}/network
${PROJECT_SOURCE_DIR}/network/socks
${PROJECT_SOURCE_DIR}/fifo
)
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME}
pthread
)
INSTALL(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION bin)