summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2024-05-18 14:48:12 +0500
committerilotterytea <iltsu@alright.party>2024-05-18 14:48:12 +0500
commitd1793df1eda463b10107d41785ad1d7f055ed476 (patch)
treefd3e41c3b4a05924748ae4b762e1ae55a0bc815c /CMakeLists.txt
parentd7a2de17e9b7931f68b5b4079b1c36866a19d343 (diff)
upd: moved the bot part to a relative subfolder
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt83
1 files changed, 43 insertions, 40 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4146b6..1fef134 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.10)
+include(FetchContent)
project(
RedpilledBot
@@ -13,53 +14,55 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_definitions(-DUSE_TLS=1)
-add_executable(Bot)
+file(GLOB_RECURSE BOT_SRC_FILES "bot/src/*.cpp" "bot/src/*.h" "bot/src/*.hpp")
-if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- target_compile_definitions(Bot PRIVATE DEBUG_MODE)
-endif()
+option(BUILD_BOT "Build the bot" ON)
-set_target_properties(
- Bot PROPERTIES
- DESCRIPTION ${PROJECT_DESCRIPTION}
- OUTPUT_NAME "redpilledbot"
-)
+if (BUILD_BOT)
+ add_executable(Bot)
-file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.h" "src/*.hpp")
+ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+ target_compile_definitions(Bot PRIVATE DEBUG_MODE)
+ endif()
-target_sources(Bot PRIVATE ${SRC_FILES})
+ set_target_properties(
+ Bot PROPERTIES
+ DESCRIPTION ${PROJECT_DESCRIPTION}
+ OUTPUT_NAME "redpilledbot"
+ )
-# Getting libraries
-include(FetchContent)
+ target_sources(Bot PRIVATE ${BOT_SRC_FILES})
-# json
-FetchContent_Declare(
- json
- URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
-)
-FetchContent_MakeAvailable(json)
+ # Getting libraries
+ # json
+ FetchContent_Declare(
+ json
+ URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
+ )
+ FetchContent_MakeAvailable(json)
-# http request maker
-FetchContent_Declare(
- cpr
- GIT_REPOSITORY https://github.com/libcpr/cpr.git
- GIT_TAG 1.10.5
-)
-FetchContent_MakeAvailable(cpr)
+ # http request maker
+ FetchContent_Declare(
+ cpr
+ GIT_REPOSITORY https://github.com/libcpr/cpr.git
+ GIT_TAG 1.10.5
+ )
+ FetchContent_MakeAvailable(cpr)
-# postgresql
-FetchContent_Declare(
- pqxx
- GIT_REPOSITORY https://github.com/jtv/libpqxx.git
- GIT_TAG 7.9.0
-)
-FetchContent_MakeAvailable(pqxx)
+ # postgresql
+ FetchContent_Declare(
+ pqxx
+ GIT_REPOSITORY https://github.com/jtv/libpqxx.git
+ GIT_TAG 7.9.0
+ )
+ FetchContent_MakeAvailable(pqxx)
-FetchContent_Declare(
- ixwebsocket
- GIT_REPOSITORY https://github.com/machinezone/IXWebSocket
- GIT_TAG v11.4.5
-)
-FetchContent_MakeAvailable(ixwebsocket)
+ FetchContent_Declare(
+ ixwebsocket
+ GIT_REPOSITORY https://github.com/machinezone/IXWebSocket
+ GIT_TAG v11.4.5
+ )
+ FetchContent_MakeAvailable(ixwebsocket)
-target_link_libraries(Bot PRIVATE ixwebsocket::ixwebsocket pqxx nlohmann_json::nlohmann_json cpr::cpr)
+ target_link_libraries(Bot PRIVATE ixwebsocket::ixwebsocket pqxx nlohmann_json::nlohmann_json cpr::cpr)
+endif()