Skip to content

Commit

Permalink
Add include dir variable in package
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme committed Mar 29, 2024
1 parent d7dead0 commit 5934b42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,11 @@ if (WITH_ADIAK)
list(APPEND CALIPER_EXTERNAL_LIBS ${CMAKE_DL_LIBS})
endif()
else()
set(CALIPER_HAVE_ADIAK FALSE)
message(WARNING "Adiak support was requested but Adiak was not found")
endif()
else()
set(CALIPER_HAVE_ADIAK FALSE)
endif()

if (WITH_KOKKOS)
Expand Down Expand Up @@ -528,11 +531,15 @@ if (INSTALL_CONFIG)
SameMajorVersion
)

set(caliper_INSTALL_INCLUDE_DIR "include/")

configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/caliper-config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/caliper-config.cmake"
INSTALL_DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/cmake/caliper
PATH_VARS
caliper_INSTALL_INCLUDE_DIR
)

install(
Expand Down
2 changes: 2 additions & 0 deletions caliper-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ include(CMakeFindDependencyMacro)

include("${CMAKE_CURRENT_LIST_DIR}/caliper-targets.cmake")

set_and_check(caliper_INCLUDE_DIR "@PACKAGE_caliper_INSTALL_INCLUDE_DIR@")

if (@CALIPER_HAVE_ADIAK@)
if (NOT TARGET adiak::adiak)
set(CALIPER_ADIAK_DIR @adiak_DIR@)
Expand Down

0 comments on commit 5934b42

Please sign in to comment.