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)
|
2023-09-16 16:29:03 +02:00
|
|
|
|
|
|
|
include(CMakeMacros.txt)
|
|
|
|
|
|
|
|
add_subdirectory(Source)
|
|
|
|
add_subdirectory(Includes)
|
|
|
|
|
2022-08-23 14:13:21 +02:00
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/)
|
2023-09-16 16:29:03 +02:00
|
|
|
get_property(source_files GLOBAL PROPERTY SRCS)
|
|
|
|
set(SOURCE_FILES ${source_files})
|
2022-08-23 14:13:21 +02:00
|
|
|
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")
|
|
|
|
|
2023-09-16 16:29:03 +02:00
|
|
|
get_property(header_files GLOBAL PROPERTY Headers)
|
|
|
|
|
|
|
|
install(FILES ${header_files} DESTINATION include/VWeb-${version})
|
2023-09-02 14:17:56 +02:00
|
|
|
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})
|