From 4a2d18e319708e6c16a9170d1acfc4124aa39740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Wed, 30 Apr 2025 11:58:34 +0200 Subject: [PATCH] Update CMakeLists --- CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++ cmake/bayesnetConfig.cmake.in | 4 ++++ 2 files changed, 41 insertions(+) create mode 100644 cmake/bayesnetConfig.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index ed782c4..69521f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,43 @@ MESSAGE(STATUS "Testing enabled") add_subdirectory(tests) endif (ENABLE_TESTING) + + +############################################################################################# +############################################################################################# +install(TARGETS bayesnet + EXPORT bayesnetTargets + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +install(EXPORT bayesnetTargets + FILE bayesnetTargets.cmake + NAMESPACE bayesnet:: + DESTINATION lib/cmake/bayesnet +) + +include(CMakePackageConfigHelpers) + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/bayesnetConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/bayesnetConfig.cmake" + INSTALL_DESTINATION lib/cmake/bayesnet +) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/bayesnetConfig.cmake" + DESTINATION lib/cmake/bayesnet +) +install(DIRECTORY bayesnet/ DESTINATION include/bayesnet FILES_MATCHING CONFIGURATIONS Release PATTERN "*.h") +install(FILES ${CMAKE_BINARY_DIR}/configured_files/include/bayesnet/config.h DESTINATION include/bayesnet CONFIGURATIONS Release) + +############################################################################################# +############################################################################################# + + + # Installation # ------------ # install(TARGETS BayesNet diff --git a/cmake/bayesnetConfig.cmake.in b/cmake/bayesnetConfig.cmake.in new file mode 100644 index 0000000..2194463 --- /dev/null +++ b/cmake/bayesnetConfig.cmake.in @@ -0,0 +1,4 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/bayesnetTargets.cmake") +