-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (44 loc) · 1.29 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
cmake_minimum_required(VERSION 3.22)
project(TRLBot VERSION 1.0 DESCRIPTION "A discord bot for Triton Rocket League.")
set(CMAKE_CXX_STANDARD 20)
#set(OPENSSL_USE_STATIC_LIBS TRUE)
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
set(HTTPLIB_IS_USING_OPENSSL TRUE)
endif()
# Add DPP as dependency
add_subdirectory(libs/DPP)
# Add cpp-httplib as a dependency
add_subdirectory(libs/cpp-httplib)
# Add sqlite-cpp as a dep
add_subdirectory(libs/sqlitecpp)
# Create target
add_executable(${PROJECT_NAME} main.cpp)
# Add all project dirs
add_subdirectory(src)
# Set C++ version
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
)
# Copy quotes json
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/quotes.json
${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
# Linking libraries
target_link_libraries(${PROJECT_NAME} PUBLIC
$<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:OpenSSL::SSL>
$<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:OpenSSL::Crypto>
httplib
dpp
SQLiteCpp
sqlite3
pthread
dl
)
target_compile_definitions(${PROJECT_NAME} PUBLIC
$<$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>:CPPHTTPLIB_OPENSSL_SUPPORT>
)
# Specify includes for dpp
target_include_directories(${PROJECT_NAME} PUBLIC
libs/DPP/include
)