2022-08-28 15:37:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.20)
|
|
|
|
project(backend)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
|
|
|
|
|
|
|
add_executable(backend
|
|
|
|
src/main.cpp
|
|
|
|
|
|
|
|
src/dto/dto.h
|
|
|
|
src/dto/responses.cpp
|
|
|
|
|
|
|
|
src/db/db.h
|
|
|
|
src/db/db.cpp
|
|
|
|
|
|
|
|
src/db/model/Inode.cc
|
|
|
|
src/db/model/Inode.h
|
|
|
|
src/db/model/Tokens.cc
|
|
|
|
src/db/model/Tokens.h
|
|
|
|
src/db/model/User.cc
|
|
|
|
src/db/model/User.h
|
|
|
|
|
|
|
|
src/controllers/controllers.h
|
|
|
|
src/controllers/admin.cpp
|
|
|
|
src/controllers/fs.cpp
|
|
|
|
src/controllers/user.cpp
|
2022-08-28 16:29:11 +00:00
|
|
|
|
2022-08-28 15:37:09 +00:00
|
|
|
src/controllers/auth/auth_common.cpp
|
|
|
|
src/controllers/auth/auth_basic.cpp
|
|
|
|
src/controllers/auth/auth_2fa.cpp
|
2022-08-28 16:29:11 +00:00
|
|
|
src/controllers/auth/auth_gitlab.cpp
|
2022-08-28 15:37:09 +00:00
|
|
|
|
|
|
|
src/filters/filters.h
|
|
|
|
src/filters/filters.cpp
|
2022-08-28 16:29:11 +00:00
|
|
|
)
|
2022-08-28 15:37:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
find_package(Drogon CONFIG REQUIRED)
|
|
|
|
find_package(CURL CONFIG REQUIRED)
|
|
|
|
find_package(PNG REQUIRED)
|
|
|
|
find_path(JWT_CPP_INCLUDE_DIRS "jwt-cpp/base.h")
|
|
|
|
find_path(BOTAN_INCLUDE_DIRS "botan/botan.h")
|
|
|
|
find_path(QR_INCLUDE_DIRS "qrcodegen.hpp")
|
|
|
|
find_path(PNGPP_INCLUDE_DIRS "png++/color.hpp")
|
|
|
|
find_library(BOTAN_LIBRARY botan-2)
|
|
|
|
find_library(QR_LIBRARY nayuki-qr-code-generator)
|
|
|
|
|
|
|
|
target_include_directories(backend PRIVATE
|
|
|
|
src
|
|
|
|
${JWT_CPP_INCLUDE_DIRS}
|
|
|
|
${BOTAN_INCLUDE_DIRS}
|
|
|
|
${QR_INCLUDE_DIRS}
|
|
|
|
${PNGPP_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(backend
|
|
|
|
Drogon::Drogon
|
|
|
|
CURL::libcurl
|
|
|
|
PNG::PNG
|
|
|
|
${BOTAN_LIBRARY}
|
|
|
|
${QR_LIBRARY}
|
|
|
|
)
|
|
|
|
|
2022-08-28 16:29:11 +00:00
|
|
|
install(TARGETS backend)
|
|
|
|
|
2022-08-28 15:37:09 +00:00
|
|
|
target_compile_options(backend PRIVATE
|
|
|
|
$<$<CONFIG:Debug>:-g -Wall -Wno-unknown-pragmas>
|
|
|
|
$<$<CONFIG:Release>:-O3>
|
|
|
|
)
|