Skip to content

Commit

Permalink
fixup: use imported target for HIP hypre
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Aug 9, 2023
1 parent df64751 commit 8516ce7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ Cabana_add_dependency( PACKAGE ALL )
find_package( CLANG_FORMAT 10 )

# find hypre
Cabana_add_dependency( PACKAGE HYPRE VERSION 2.22.1 )
if(Kokkos_ENABLE_HIP)
pkg_check_modules(PC_HYPRE hypre IMPORTED_TARGET)
add_library(ALIAS hypre::hypre pkgconfig:HYPRE)
else()
Cabana_add_dependency( PACKAGE HYPRE VERSION 2.22.1 )
endif()

# find heffte
Cabana_add_dependency( PACKAGE Heffte VERSION 2.1.0 )
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindHYPRE.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
find_package(PkgConfig QUIET)
pkg_check_modules(PC_HYPRE hypre QUIET)
pkg_check_modules(PC_HYPRE hypre QUIET IMPORTED_TARGET)

find_path(HYPRE_INCLUDE_DIR hypre.h HINTS ${PC_HYPRE_INCLUDE_DIRS})
find_library(HYPRE_LIBRARY NAMES HYPRE HINTS ${PC_HYPRE_LIBRARY_DIRS})
Expand Down

0 comments on commit 8516ce7

Please sign in to comment.