2023-11-21 22:19:08 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
project(pica
|
|
|
|
VERSION 0.0.1
|
|
|
|
LANGUAGES CXX
|
|
|
|
)
|
2023-12-10 23:23:15 +00:00
|
|
|
set(PROJECT_LICENSE "GPL-3.0")
|
2023-11-21 14:24:12 +00:00
|
|
|
|
2023-12-07 20:32:43 +00:00
|
|
|
cmake_policy(SET CMP0076 NEW) #allow adding sources from subdir
|
|
|
|
cmake_policy(SET CMP0079 NEW) #allow linking from subdirs
|
2023-11-21 22:19:08 +00:00
|
|
|
|
2023-12-10 23:23:15 +00:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2023-11-21 22:19:08 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2023-11-29 13:09:11 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
2023-12-10 23:23:15 +00:00
|
|
|
set(PICA_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
2023-11-21 22:19:08 +00:00
|
|
|
|
2023-11-23 19:57:32 +00:00
|
|
|
find_package(nlohmann_json REQUIRED)
|
2023-11-29 13:09:11 +00:00
|
|
|
find_package(FCGI REQUIRED)
|
2023-11-21 14:24:12 +00:00
|
|
|
|
|
|
|
add_executable(pica main.cpp)
|
2023-11-21 22:19:08 +00:00
|
|
|
target_include_directories(pica PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
2023-12-10 23:23:15 +00:00
|
|
|
target_include_directories(pica PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
2023-11-21 22:19:08 +00:00
|
|
|
|
|
|
|
add_subdirectory(server)
|
|
|
|
add_subdirectory(request)
|
|
|
|
add_subdirectory(response)
|
|
|
|
add_subdirectory(stream)
|
2023-12-07 20:32:43 +00:00
|
|
|
add_subdirectory(database)
|
2023-12-10 23:23:15 +00:00
|
|
|
add_subdirectory(utils)
|
|
|
|
|
|
|
|
configure_file(config.h.in config.h @ONLY)
|
2023-11-21 22:19:08 +00:00
|
|
|
|
2023-11-23 19:57:32 +00:00
|
|
|
target_link_libraries(pica PRIVATE
|
2023-11-29 13:09:11 +00:00
|
|
|
FCGI::FCGI
|
|
|
|
FCGI::FCGI++
|
2023-11-23 19:57:32 +00:00
|
|
|
nlohmann_json::nlohmann_json
|
2023-11-21 22:19:08 +00:00
|
|
|
)
|
2023-11-21 14:24:12 +00:00
|
|
|
|
2023-12-10 23:23:15 +00:00
|
|
|
install(TARGETS pica RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|