Touch up CMakeFile

FossilOrigin-Name: 76ce1b4b802e2c714113bbaed33fd7944898664cf59aa6e378af206bb37556f6
This commit is contained in:
nekobit 2022-12-23 04:48:06 +00:00
parent e225093e35
commit 09f993d8a3

View file

@ -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}")