Add convenient CMake alias (#563)

Usually consumers of HYPRE call find_package(HYPRE) and depend on
HYPRE::HYPRE target.  But they could also want to use HYPRE via
add_directory (for instance via a git submodule)) or FetchContent,
in which case they have to depend on HYPRE target.

This alias makes this usage more consistent, all users could then
depend on HYPRE::HYPRE.  See for instance
  https://cmake.org/pipermail/cmake/2018-November/068629.html
This commit is contained in:
Denis Barbier 2022-01-25 21:06:47 +01:00 committed by GitHub
parent 84fa589671
commit dcbee14539
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -549,4 +549,8 @@ export(EXPORT HYPRETargets
NAMESPACE HYPRE::
)
# Declare an alias so that consumers can depend on HYPRE::HYPRE target
# also when using HYPRE via add_directory or FetchContent
add_library(HYPRE::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
export(PACKAGE ${PROJECT_NAME})