-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
46 lines (35 loc) · 1002 Bytes
/
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
cmake_minimum_required (VERSION 3.6)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(BOT_NAME "command_example")
project(${BOT_NAME})
aux_source_directory("src" coresrc)
aux_source_directory("src/commands" commands)
add_executable(${BOT_NAME} ${coresrc} ${commands})
string(ASCII 27 Esc)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set_target_properties(${BOT_NAME} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
find_package(DPP REQUIRED)
find_package(fmt REQUIRED)
if(APPLE)
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
find_package(OpenSSL REQUIRED)
else()
find_package(OpenSSL REQUIRED)
endif()
target_include_directories(${BOT_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${DPP_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR}
)
target_link_libraries(${BOT_NAME}
${CMAKE_THREAD_LIBS_INIT}
${DPP_LIBRARIES}
${OPENSSL_CRYPTO_LIBRARY}
${OPENSSL_SSL_LIBRARY}
fmt::fmt
)