Meta: Move install rules to its own helper cmake file

This feels like a thing that belongs somewhere else than the top level
CMakeLists file.
This commit is contained in:
Undefine 2026-03-27 23:31:07 +01:00 committed by Andrew Kaster
parent a977e04efb
commit 731f1678ba
2 changed files with 26 additions and 24 deletions

View file

@ -132,30 +132,7 @@ include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_BINARY_DIR}/Libraries)
include_directories(${CMAKE_BINARY_DIR}/Services)
# install rules, think about moving to its own helper cmake file
include(CMakePackageConfigHelpers)
# find_package(<package>) call for consumers to find this project
set(package Lagom CACHE STRING "")
# Allow package maintainers to freely override the path for the configs
set(Lagom_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR}/${package}"
CACHE PATH "CMake package config location relative to the install prefix")
mark_as_advanced(Lagom_INSTALL_CMAKEDIR)
install(
FILES "${LADYBIRD_SOURCE_DIR}/Meta/CMake/lagom-install-config.cmake"
DESTINATION "${Lagom_INSTALL_CMAKEDIR}"
RENAME "${package}Config.cmake"
COMPONENT Lagom_Development
)
install(
EXPORT LagomTargets
NAMESPACE Lagom::
DESTINATION "${Lagom_INSTALL_CMAKEDIR}"
COMPONENT Lagom_Development
)
include(lagom_install)
if (WIN32)
find_package(pthread REQUIRED)

View file

@ -0,0 +1,25 @@
include_guard()
include(CMakePackageConfigHelpers)
# find_package(<package>) call for consumers to find this project
set(package Lagom CACHE STRING "")
# Allow package maintainers to freely override the path for the configs
set(Lagom_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR}/${package}"
CACHE PATH "CMake package config location relative to the install prefix")
mark_as_advanced(Lagom_INSTALL_CMAKEDIR)
install(
FILES "${LADYBIRD_SOURCE_DIR}/Meta/CMake/lagom-install-config.cmake"
DESTINATION "${Lagom_INSTALL_CMAKEDIR}"
RENAME "${package}Config.cmake"
COMPONENT Lagom_Development
)
install(
EXPORT LagomTargets
NAMESPACE Lagom::
DESTINATION "${Lagom_INSTALL_CMAKEDIR}"
COMPONENT Lagom_Development
)