diff options
| author | ilotterytea <iltsu@alright.party> | 2024-05-18 16:29:46 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-05-18 16:29:46 +0500 |
| commit | 8f3abd66d3d0a70c9dbd790e430bf8690f58c49f (patch) | |
| tree | 5801e52f2473288f568ced7575344960a7f81ff9 /CMakeLists.txt | |
| parent | d1793df1eda463b10107d41785ad1d7f055ed476 (diff) | |
feat: web project
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fef134..2bd6745 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,10 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_definitions(-DUSE_TLS=1) file(GLOB_RECURSE BOT_SRC_FILES "bot/src/*.cpp" "bot/src/*.h" "bot/src/*.hpp") +file(GLOB_RECURSE WEB_SRC_FILES "web/src/*.cpp" "web/src/*.h" "web/src/*.hpp") option(BUILD_BOT "Build the bot" ON) +option(BUILD_WEB "Build the web application" ON) if (BUILD_BOT) add_executable(Bot) @@ -66,3 +68,25 @@ if (BUILD_BOT) target_link_libraries(Bot PRIVATE ixwebsocket::ixwebsocket pqxx nlohmann_json::nlohmann_json cpr::cpr) endif() + +if (BUILD_WEB) + add_executable(Web) + + set_target_properties( + Web PROPERTIES + DESCRIPTION ${PROJECT_DESCRIPTION} + OUTPUT_NAME "redpilledweb" + ) + + target_sources(Web PRIVATE ${WEB_SRC_FILES}) + + # web framework + FetchContent_Declare( + crow + GIT_REPOSITORY https://github.com/CrowCpp/Crow + GIT_TAG v1.1.0 + ) + FetchContent_MakeAvailable(crow) + + target_include_directories(Web PRIVATE ${crow_SOURCE_DIR}/include) +endif() |
