-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
45 lines (37 loc) · 1.24 KB
/
CMakeLists.txt
File metadata and controls
45 lines (37 loc) · 1.24 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
cmake_minimum_required (VERSION 3.11.2)
project (telegram_notifier)
set (CMAKE_CXX_STANDARD 17)
set (THREADS_PREFER_PTHREAD_FLAG ON)
find_package (Threads REQUIRED)
find_package (jsoncpp REQUIRED)
find_package (CURL REQUIRED)
find_package (Boost COMPONENTS system REQUIRED)
include_directories (src/)
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
# XXX: Is there a proper way to set -pthread while compiling all files?
# This is a workaround to set it for all files. Without this it is only set for telegram_notifier.cpp.
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set (BOT_SOURCES
src/bot/bot.cpp
)
set (CURL_HANDLE_SOURCES
src/curl_handle/curl_handle.cpp
)
set (GLOBAL_SOURCES
src/global/global.cpp
)
set (TELEGRAM_NOTIFIER_SOURCES
src/telegram_notifier.cpp
)
add_library (bot_lib
${BOT_SOURCES}
)
add_library (curl_handle_lib
${CURL_HANDLE_SOURCES}
)
add_library (global_lib
${GLOBAL_SOURCES}
)
add_executable (telegrambotd ${TELEGRAM_NOTIFIER_SOURCES})
# XXX: Why the fuck -ljsoncpp is not added? This crap is completely braindead.
target_link_libraries (telegrambotd bot_lib global_lib curl_handle_lib ${CURL_LIBRARIES} ${Boost_SYSTEM_LIBRARIES} ${JSONCPP_LIBRARIES} Threads::Threads -ljsoncpp)