# CMake script for PAPPSOms++ library
# Author: Olivier Langella
# Created: 03/03/2015
# Rework: April 2020 (Coronavirus confinement)
# Major rework of the whole project structure, Filippo Rusconi, summer 2025

message("\n${BoldGreen}Now configuring src/ for ${PROJECT_NAME}${ColourReset}\n")

# See below how this file is installed in the destination /prefix/include/pappsomspp directory.
configure_file(${CMAKE_UTILS_PATH}/src-pappsomspp-config.h.cmake.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h)

# Now we can configure the build of both libraries
add_subdirectory(core)
add_subdirectory(gui)


# Install headers (valid for both the static and the shared lib versions)
install(
    DIRECTORY core
    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pappsomspp/
    FILES_MATCHING
    PATTERN "*.h"
    PATTERN "*.hpp"
)

# Install headers (valid for both the static and the shared lib versions)
install(
    DIRECTORY gui
    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pappsomspp/
    FILES_MATCHING
    PATTERN "*.h"
    PATTERN "*.hpp"
)

# Install headers (valid for both the static and the shared lib versions)
message("Installing config.h from ${CMAKE_CURRENT_BINARY_DIR} to ${CMAKE_INSTALL_INCLUDEDIR}/pappsomspp")
install(
    FILES config.h export-import-config.h
    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pappsomspp
)

message("\n${BoldGreen}Done configuring src/ for ${PROJECT_NAME}${ColourReset}\n")
