2022-09-10 15:09:18 +02:00
|
|
|
cmake_minimum_required(VERSION 3.21)
|
2023-09-02 14:17:56 +02:00
|
|
|
set(version 1.0)
|
|
|
|
project(VWeb VERSION ${version})
|
|
|
|
set(project_lower vweb)
|
|
|
|
|
2022-08-23 14:13:21 +02:00
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUGSOFT")
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
set(SOURCE_FILES
|
|
|
|
Source/EPollManager.cpp
|
|
|
|
Source/RequestHandler.cpp
|
|
|
|
Source/Server.cpp
|
|
|
|
Source/SocketManager.cpp
|
|
|
|
Source/ThreadPool.cpp
|
|
|
|
Source/Router.cpp
|
|
|
|
Source/MiddleWare.cpp
|
|
|
|
Source/Route.cpp
|
|
|
|
Source/StringUtils.cpp
|
|
|
|
Source/Cookie.cpp
|
|
|
|
Source/Session.cpp
|
2022-11-09 14:34:20 +01:00
|
|
|
Source/Response.cpp
|
|
|
|
Source/InbuildMiddleWare.cpp)
|
2022-08-23 14:13:21 +02:00
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/)
|
|
|
|
add_library(VWeb ${SOURCE_FILES})
|
|
|
|
|
2023-09-02 14:17:56 +02:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
|
|
|
set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
|
|
|
|
set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
|
|
|
|
set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
|
|
|
|
|
|
|
|
install(FILES VWeb.h DESTINATION include/VWeb-${version})
|
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
|
|
EXPORT ${PROJECT_NAME}-targets
|
|
|
|
LIBRARY DESTINATION lib/$<CONFIG>
|
|
|
|
ARCHIVE DESTINATION lib/$<CONFIG>
|
|
|
|
)
|
|
|
|
install(EXPORT ${PROJECT_NAME}-targets
|
|
|
|
DESTINATION lib/${PROJECT_NAME}-${version})
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
${PROJECT_SOURCE_DIR}/pkg/${project_lower}-config.cmake.in
|
|
|
|
${PROJECT_BINARY_DIR}/pkg/${project_lower}-config.cmake @ONLY)
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
${PROJECT_SOURCE_DIR}/${project_lower}-config-version.cmake.in
|
|
|
|
${PROJECT_BINARY_DIR}/${project_lower}-config-version.cmake @ONLY)
|
|
|
|
|
|
|
|
install(FILES ${PROJECT_BINARY_DIR}/pkg/${project_lower}-config.cmake
|
|
|
|
${PROJECT_BINARY_DIR}/${project_lower}-config-version.cmake
|
|
|
|
DESTINATION lib/${PROJECT_NAME}-${version})
|