pica/CMakeLists.txt

41 lines
1.0 KiB
CMake
Raw Normal View History

2023-11-21 22:19:08 +00:00
cmake_minimum_required(VERSION 3.5)
project(pica
VERSION 0.0.1
LANGUAGES CXX
)
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
include(GNUInstallDirs)
2023-11-21 22:19:08 +00:00
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
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)
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})
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)
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
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
install(TARGETS pica RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})