Skip to content

Commit

Permalink
check on target
Browse files Browse the repository at this point in the history
  • Loading branch information
RMeli committed Jun 3, 2024
1 parent a86eaff commit 9e7b30f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
16 changes: 7 additions & 9 deletions cmake/FindSCALAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ find_library(
PATH_SUFFIXES lib
)

find_package_handle_standard_args(DLAF_SCALAPACK DEFAULT_MSG DLAF_SCALAPACK_LIBRARY)
find_package_handle_standard_args(SCALAPACK DEFAULT_MSG DLAF_SCALAPACK_LIBRARY)

mark_as_advanced(DLAF_SCALAPACK_LIBRARY)
mark_as_advanced(DLAF_SCALAPACK_INCLUDE_DIR)
mark_as_advanced(SCALAPACK_LIBRARY)
mark_as_advanced(SCALAPACK_INCLUDE_DIR)

if(DLAF_SCALAPACK_FOUND)
if(NOT TARGET DLAF::SCALAPACK)
add_library(DLAF::SCALAPACK INTERFACE IMPORTED GLOBAL)
endif()
if(NOT TARGET DLAF::SCALAPACK)
add_library(DLAF::SCALAPACK INTERFACE IMPORTED GLOBAL)

target_link_libraries(DLAF::SCALAPACK INTERFACE "${DLAF_SCALAPACK_LIBRARY}")
target_include_directories(DLAF::SCALAPACK INTERFACE "${DLAF_SCALAPACK_INCLUDE_DIR}")
target_link_libraries(DLAF::SCALAPACK INTERFACE "${SCALAPACK_LIBRARY}")
target_include_directories(DLAF::SCALAPACK INTERFACE "${SCALAPACK_INCLUDE_DIR}")
endif()
4 changes: 2 additions & 2 deletions cmake/template/DLAFConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ set(LAPACK_INCLUDE_DIR "@LAPACK_INCLUDE_DIR@")
find_dependency(LAPACK)

if(DLAF_WITH_SCALAPACK)
set(DLAF_SCALAPACK_LIBRARY "@DLAF_SCALAPACK_LIBRARY@")
set(DLAF_SCALAPACK_INCLUDE_DIR "@DLAF_SCALAPACK_INCLUDE_DIR@")
set(SCALAPACK_LIBRARY "@SCALAPACK_LIBRARY@")
set(SCALAPACK_INCLUDE_DIR "@_SCALAPACK_INCLUDE_DIR@")
find_dependency(SCALAPACK)
endif()

Expand Down
2 changes: 1 addition & 1 deletion spack/packages/dla-future/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def cmake_args(self):
)
)
if "+scalapack" in spec:
args.append(self.define("DLAF_SCALAPACK_LIBRARY", spec["scalapack"].libs.ld_flags))
args.append(self.define("SCALAPACK_LIBRARY", spec["scalapack"].libs.ld_flags))

args.append(self.define_from_variant("DLAF_WITH_SCALAPACK", "scalapack"))

Expand Down

0 comments on commit 9e7b30f

Please sign in to comment.