diff --git a/CMakeLists.txt b/CMakeLists.txt index 490f18cd..a9e9990b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,7 @@ if (magistrate_ubsan_enabled) endif() endif() -set(MAGISTRATE_LIBRARY checkpoint CACHE INTERNAL "" FORCE ) +set(MAGISTRATE_LIBRARY magistrate CACHE INTERNAL "" FORCE ) set(MAGISTRATE_LIBRARY_NS vt::lib::magistrate "" CACHE INTERNAL "" FORCE ) set(CMAKE_CXX_EXTENSIONS OFF) @@ -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..4ff112bc --- /dev/null +++ b/cmake/magistrateConfig.cmake.in @@ -0,0 +1,18 @@ +# Get compiler and flags +get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +include(${SELF_DIR}/magistrateTargets.cmake) + +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..a46b6664 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 magistrate) add_library(${MAGISTRATE_LIBRARY_NS} ALIAS ${MAGISTRATE_LIBRARY}) target_compile_features(${MAGISTRATE_LIBRARY} PUBLIC cxx_std_17)