-
Notifications
You must be signed in to change notification settings - Fork 22
/
CMakeLists.txt
40 lines (31 loc) · 1.01 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
# CMake version
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
# Project
PROJECT(openwebtorrent-tracker)
# Add a compiler flag
SET(CMAKE_CC_COMPILER /usr/bin/gcc-8)
SET(CMAKE_CXX_COMPILER /usr/bin/g++-8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -DLIBUS_USE_OPENSSL -lssl -lcrypto -lstdc++")
# Dependencies
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
SET(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/deps")
FIND_PACKAGE(Threads)
FIND_PACKAGE(uWebSockets REQUIRED)
# uWebsockets
INCLUDE_DIRECTORIES(${UWEBSOCKETS_INCLUDE_DIR})
# JSON
INCLUDE_DIRECTORIES(${CMAKE_PREFIX_PATH}/json/single_include/nlohmann)
#ADD_SUBDIRECTORY(${CMAKE_PREFIX_PATH}/json)
# CxxOpts
INCLUDE_DIRECTORIES(${CMAKE_PREFIX_PATH}/cxxopts/include)
# Libraries
SET(LIBRARIES
${CMAKE_THREAD_LIBS_INIT}
${UWEBSOCKETS_LIBRARIES}
)
# Executable
FILE(GLOB_RECURSE HEADERS src/*.h)
FILE(GLOB_RECURSE SOURCES src/*.cpp)
ADD_EXECUTABLE(${PROJECT_NAME} ${HEADERS} ${SOURCES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIBRARIES})