fileserver/backend/CMakeLists.txt

97 lines
2.5 KiB
CMake
Raw Normal View History

2022-09-03 21:32:20 +00:00
cmake_minimum_required(VERSION 3.21)
if (WIN32 AND (NOT VCPKG_TARGET_TRIPLET))
set(VCPKG_TARGET_TRIPLET x64-windows-static)
endif (WIN32 AND (NOT VCPKG_TARGET_TRIPLET))
#set(VCPKG_LIBRARY_LINKAGE static)
2022-08-28 15:37:09 +00:00
project(backend)
2022-08-31 12:28:07 +00:00
set(CMAKE_CXX_STANDARD 20)
2022-08-28 15:37:09 +00:00
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/controllers/controllers.h
src/controllers/admin.cpp
src/controllers/user.cpp
2022-08-28 16:29:11 +00:00
2022-09-04 03:33:26 +00:00
src/controllers/fs/fs_routes.cpp
src/controllers/fs/fs_functions.cpp
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-09-03 21:32:20 +00:00
model/Inode.cc
model/Inode.h
model/Tokens.cc
model/Tokens.h
model/User.cc
model/User.h
SMTPMail-drogon-master/SMTPMail.cc
2022-08-28 16:29:11 +00:00
)
2022-08-28 15:37:09 +00:00
find_package(Drogon CONFIG REQUIRED)
2022-08-31 12:28:07 +00:00
find_package(OpenSSL REQUIRED)
2022-09-03 21:32:20 +00:00
find_package(OpenCV CONFIG REQUIRED)
find_package(kubazip CONFIG REQUIRED)
2022-08-28 15:37:09 +00:00
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")
2022-08-31 12:28:07 +00:00
find_library(BOTAN_LIBRARY NAMES botan-2 botan)
2022-08-28 15:37:09 +00:00
find_library(QR_LIBRARY nayuki-qr-code-generator)
target_include_directories(backend PRIVATE
src
2022-09-03 21:32:20 +00:00
model
shl
SMTPMail-drogon-master
${OpenCV_INCLUDE_DIRS}
2022-08-28 15:37:09 +00:00
${JWT_CPP_INCLUDE_DIRS}
${BOTAN_INCLUDE_DIRS}
${QR_INCLUDE_DIRS}
)
target_link_libraries(backend
Drogon::Drogon
2022-08-31 12:28:07 +00:00
OpenSSL::SSL
2022-09-03 21:32:20 +00:00
kubazip::kubazip
${OpenCV_LIBS}
2022-08-28 15:37:09 +00:00
${BOTAN_LIBRARY}
${QR_LIBRARY}
)
2022-09-03 21:32:20 +00:00
set_property(TARGET backend PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
install(TARGETS backend RUNTIME_DEPENDENCY_SET backend_deps DESTINATION .)
install(RUNTIME_DEPENDENCY_SET backend_deps)
2022-08-28 16:29:11 +00:00
2022-08-31 12:28:07 +00:00
if(NOT MSVC)
target_compile_options(backend PRIVATE
$<$<CONFIG:Debug>:-g -Wall -Wno-unknown-pragmas>
$<$<CONFIG:Release>:-O3>
)
else()
target_compile_options(backend PRIVATE /W4 /wd4068)
endif(NOT MSVC)
if(WIN32)
2022-09-03 21:32:20 +00:00
target_link_libraries(backend iphlpapi)
2022-08-31 19:54:48 +00:00
target_compile_definitions(backend PRIVATE NOMINMAX _WIN32_WINNT=0x0A00)
2022-08-31 12:28:07 +00:00
endif()