rapids_find_package¶
Added in version v21.06.00.
Allow projects to find dependencies via find_package with built-in tracking of these dependencies for correct export support.
rapids_find_package(<PackageName>
[ all normal find_package options ]
[COMPONENTS <components...>]
[GLOBAL_TARGETS <targets...>]
[BUILD_EXPORT_SET <name>]
[INSTALL_EXPORT_SET <name>]
[ <FIND_ARGS>
all normal find_package options ]
)
Invokes find_package
call and
associate this with the listed build and install export set for correct export
generation. Will propagate all variables set by
find_package
to the caller’s scope.
Since the visibility of CMake’s targets differ between targets built locally and
those imported, rapids_find_package()
promotes imported targets
to be global so users have consistency. List all targets used by your project
in GLOBAL_TARGETS.
PackageName
Name of the package to find.
COMPONENTS
Added in version v22.10.00.
A list of required components that are required to be found for this package to be considered valid.
GLOBAL_TARGETS
Which targets from this package should be made global. This information will be propagated to any associated export set.
BUILD_EXPORT_SET
Record that a
find_dependency(<PackageName>)
call needs to occur as part of our build directory export set.INSTALL_EXPORT_SET
Record that a
find_dependency(<PackageName>)
call needs to occur as part of our build directory export set.FIND_ARGS
Required placeholder to be provided before any extra arguments that need to be passed down to
find_package
Note
If the project/package you are looking for doesn’t have an existing
CMake Find module, please look at using rapids_find_generate_module()
.
The rapids_find_package()
function supports two call modes.
1. When all the parameters for
find_package
are first followed by rapids parameters such as BUILD_EXPORT_SET and INSTALL_EXPORT_SET last. Here is an example of what this call would look like:rapids_find_package(ZLIB 1.2 REQUIRED GLOBAL_TARGETS ZLIB::ZLIB INSTALL_EXPORT_SET my-export-set BUILD_EXPORT_SET my-export-set )2. When the rapids parameters come first, and in that case they must be followed by the FIND_ARGS keyword. This ensures proper argument propagation to the underlying
find_package
. Here is an example of what this call would look like:rapids_find_package(ZLIB GLOBAL_TARGETS ZLIB::ZLIB INSTALL_EXPORT_SET my-export-set BUILD_EXPORT_SET my-export-set FIND_ARGS 1.2 REQUIRED )