Skip to content

Commit

Permalink
#350: Try exporting both checkpoint/magistrate targets
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Jun 24, 2024
1 parent 7fb9eee commit 19bb69f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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})
18 changes: 18 additions & 0 deletions cmake/magistrateConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 19bb69f

Please sign in to comment.