From 5a55269442281d780b0c5b2d749006ff0b73ad21 Mon Sep 17 00:00:00 2001 From: Jacob Domagala Date: Mon, 24 Jun 2024 20:31:43 +0200 Subject: [PATCH] #350: Try exporting both checkpoint/magistrate targets --- CMakeLists.txt | 11 +++++++++++ cmake/magistrateConfig.cmake.in | 19 +++++++++++++++++++ src/CMakeLists.txt | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 cmake/magistrateConfig.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 490f18cd..fe511f5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,4 +189,15 @@ install( COMPONENT extCfg ) +configure_file( + cmake/magistrateConfig.cmake.in + "${PROJECT_BINARY_DIR}/magistrateConfig.cmake" @ONLY +) + +install( + FILES "${PROJECT_BINARY_DIR}/magistrateConfig.cmake" + DESTINATION cmake + COMPONENT extCfg +) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/cmake/magistrateConfig.cmake.in b/cmake/magistrateConfig.cmake.in new file mode 100644 index 00000000..2a6ac043 --- /dev/null +++ b/cmake/magistrateConfig.cmake.in @@ -0,0 +1,19 @@ +# Get compiler and flags +get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +include(${SELF_DIR}/magistrateTargets.cmake) + +add_library(vt::lib::magistrate ALIAS vt::lib::checkpoint) +# set(vt::lib::magistrate vt::lib::checkpoint) + +include(CMakeFindDependencyMacro) + +if (@MAGISTRATE_HAS_KOKKOS_LIBRARY@) + set (kokkos_DIR @kokkos_DIR@) + find_dependency(kokkos REQUIRED HINTS @kokkos_DIR@ NAMES Kokkos) +endif() + +if (@MAGISTRATE_HAS_KOKKOS_KERNELS_LIBRARY@) + set (KokkosKernels_DIR @KokkosKernels_DIR@) + find_dependency(KokkosKernels REQUIRED HINTS @KokkosKernels_DIR@ NAMES KokkosKernels) +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index acff2fa7..067567f9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -70,7 +70,7 @@ add_library( ${MAGISTRATE_LIBRARY} ${HEADER_FILES} ${SOURCE_FILES} ) - +set_property(TARGET ${MAGISTRATE_LIBRARY} PROPERTY EXPORT_NAME checkpoint) add_library(${MAGISTRATE_LIBRARY_NS} ALIAS ${MAGISTRATE_LIBRARY}) target_compile_features(${MAGISTRATE_LIBRARY} PUBLIC cxx_std_17)