select_library_configurations(<basename>) may change <basename>_FOUND
When select_library_configurations(<basename>)
finds and sets <basename>_LIBRARY
, it also sets <basename>_FOUND
to TRUE
. However,
- this side effect is not documented,
- it is redundant, given that
<basename>_LIBRARY
alone can indicate success or failure. - it interfers with later calls to
find_package(<basename>)
.
This is an issue in dealing with "wrappers" in vcpkg, i.e. cmake scripts that ensure proper configuration of release and debug variants before the actual call to find_package()
. Now, it is necessary to explicitly unset(<basename>_FOUND)
after select_library_configurations(<basename>)
. Ideally, this would not be necessary. But if changing the behaviour is considered dangerous, it should be documented at least.
In contrast, find_package_handle_standard_args
documents the change to <basename>_FOUND
(and the feature makes sense for that function).