From 09f993d8a3936fed66d3e9f77b4911576a9b67e5 Mon Sep 17 00:00:00 2001 From: nekobit Date: Fri, 23 Dec 2022 04:48:06 +0000 Subject: [PATCH] Touch up CMakeFile FossilOrigin-Name: 76ce1b4b802e2c714113bbaed33fd7944898664cf59aa6e378af206bb37556f6 --- CMakeLists.txt | 65 +++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a88b66e..bb633e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,37 +1,48 @@ +# Invocations +# cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. +# cmake -DCMAKE_BUILD_TYPE=Debug .. +# cmake -DCMAKE_BUILD_TYPE=Release .. + cmake_minimum_required(VERSION 3.14) -project(wormhole) +project(wormhole + VERSION 0.0 + DESCRIPTION "A lightweight federated social media server" + LANGUAGES CXX) set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(Module) -# Main -add_executable(wormhole src/main.cpp) +# Main executable of Wormhole +add_executable(wormhole ${PROJECT_SOURCE_DIR}/src/main.cpp) # Separated as a library -add_library(wormhole_lib - src/jsonhelper.cpp - src/database/database_config.cpp - src/database/sqlite/sqlite.cpp - src/instance/instance.cpp - src/http/httpserver.cpp - src/http/microhttpd_server.cpp - src/http/request.cpp - src/http/response.cpp - src/http/mime.cpp - src/http/error_response.cpp - src/http/request_sender.cpp - src/crypt/rsa.cpp - src/config/config_http.cpp - src/config/config_db.cpp - src/config/config_loader.cpp - src/config/config_instance.cpp - src/config/config_frontend.cpp - src/types/user.cpp - src/types/app.cpp - src/thread_pool.cpp - src/random.cpp - src/control.cpp - src/logger.cpp) +set(SRC_FILES + ${PROJECT_SOURCE_DIR}/src/jsonhelper.cpp + ${PROJECT_SOURCE_DIR}/src/database/database_config.cpp + ${PROJECT_SOURCE_DIR}/src/database/sqlite/sqlite.cpp + ${PROJECT_SOURCE_DIR}/src/instance/instance.cpp + ${PROJECT_SOURCE_DIR}/src/http/httpserver.cpp + ${PROJECT_SOURCE_DIR}/src/http/microhttpd_server.cpp + ${PROJECT_SOURCE_DIR}/src/http/request.cpp + ${PROJECT_SOURCE_DIR}/src/http/response.cpp + ${PROJECT_SOURCE_DIR}/src/http/mime.cpp + ${PROJECT_SOURCE_DIR}/src/http/error_response.cpp + ${PROJECT_SOURCE_DIR}/src/http/request_sender.cpp + ${PROJECT_SOURCE_DIR}/src/crypt/rsa.cpp + ${PROJECT_SOURCE_DIR}/src/config/config_http.cpp + ${PROJECT_SOURCE_DIR}/src/config/config_db.cpp + ${PROJECT_SOURCE_DIR}/src/config/config_loader.cpp + ${PROJECT_SOURCE_DIR}/src/config/config_instance.cpp + ${PROJECT_SOURCE_DIR}/src/config/config_frontend.cpp + ${PROJECT_SOURCE_DIR}/src/types/user.cpp + ${PROJECT_SOURCE_DIR}/src/types/app.cpp + ${PROJECT_SOURCE_DIR}/src/thread_pool.cpp + ${PROJECT_SOURCE_DIR}/src/random.cpp + ${PROJECT_SOURCE_DIR}/src/control.cpp + ${PROJECT_SOURCE_DIR}/src/logger.cpp) +add_library(wormhole_lib ${SRC_FILES}) + +# These go to all targets add_definitions(-DCONFIG_DIR="${CONFIG_DIR}" -DDATA_DIR="${DATA_DIR}")