Skip to content

Commit

Permalink
Allow linking against build tree (kokkos#6078)
Browse files Browse the repository at this point in the history
* Allow linking against build tree

* Use Kokkos_BINARY_DIR instead of CMAKE_BINARY_DIR
  • Loading branch information
masterleinad committed May 25, 2023
1 parent b3f9f78 commit e88537f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ jobs:
- name: Tests
working-directory: builddir
run: ctest --output-on-failure
- name: Test linking against build dir
working-directory: example/build_cmake_installed
run: |
cmake -B builddir_buildtree -DCMAKE_CXX_COMPILER=${{ matrix.cxx }} -DKokkos_ROOT=../../builddir
cmake --build builddir_buildtree
cmake --build builddir_buildtree --target test
- name: Test DESTDIR Install
run: DESTDIR=${PWD}/install cmake --build builddir --target install && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install
- name: Install
Expand Down
1 change: 1 addition & 0 deletions cmake/kokkos_install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ IF (NOT KOKKOS_HAS_TRILINOS AND NOT Kokkos_INSTALL_TESTING)
"${Kokkos_BINARY_DIR}/KokkosConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Kokkos)
install(EXPORT KokkosTargets NAMESPACE Kokkos:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Kokkos)
export(EXPORT KokkosTargets NAMESPACE Kokkos:: FILE ${Kokkos_BINARY_DIR}/KokkosTargets.cmake)
ELSE()
CONFIGURE_FILE(cmake/KokkosConfigCommon.cmake.in ${Kokkos_BINARY_DIR}/KokkosConfigCommon.cmake @ONLY)
file(READ ${Kokkos_BINARY_DIR}/KokkosConfigCommon.cmake KOKKOS_CONFIG_COMMON)
Expand Down

0 comments on commit e88537f

Please sign in to comment.