-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
60 lines (45 loc) · 1.28 KB
/
CMakeLists.txt
File metadata and controls
60 lines (45 loc) · 1.28 KB
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
cmake_minimum_required(VERSION 2.6)
# Handle policies
cmake_policy(SET CMP0011 NEW)
if(POLICY CMP0058)
cmake_policy(SET CMP0058 NEW)
endif()
project(BitTorrentProject)
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake
)
set(LANGUAGE "CXX")
# Use C++17
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
# Dependencies
# SDL2 Libraries
find_package(SDL2 REQUIRED)
find_package(SDL2_gfx REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_ttf REQUIRED)
# OpenSSL or LibreSSL
if(APPLE AND NOT OPENSSL_ROOT_DIR)
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
endif()
find_package(OpenSSL REQUIRED)
# Boost
find_package(Boost 1.58.0 COMPONENTS system filesystem REQUIRED)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
# PCH support
include(cotire)
# For Unix systems set the rpath so that libraries are found
set(CMAKE_INSTALL_RPATH ${LIBS_DIR})
set(CMAKE_INSTALL_NAME_DIR ${LIBS_DIR})
# Run out of build tree
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)
# Project info
set(client_EXEC bitclient)
set(framework_LIB framework)
set(torrent_LIB torrent_protocol)
set(FRAMEWORK_SRC_DIR ${CMAKE_SOURCE_DIR}/src/framework)
set(TORRENT_SRC_DIR ${CMAKE_SOURCE_DIR}/src/torrent_protocol)
# Source Tree
add_subdirectory(src)