diff --git a/CMakeLists.txt b/CMakeLists.txt index 69e62ab5..ba492dcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ project(arcus) cmake_minimum_required(VERSION 3.20) + +include(CMakePackageConfigHelpers) include(cmake/StandardProjectSettings.cmake) option(BUILD_PYTHON "Build Python bindings for this library" ON) @@ -61,6 +63,19 @@ install(TARGETS Arcus PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) +install( + EXPORT Arcus-targets + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Arcus +) +configure_package_config_file( + ArcusConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/ArcusConfig.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Arcus +) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ArcusConfig.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Arcus +) + # Create the Python bindings if(BUILD_PYTHON) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)