CMake: Assign FindWrapFoo_VERSION variable in QtFindWrapHelper.cmake

The QtFindWrapHelper.cmake file retrieves the version of the
underlying system package version or bundled package version, and
passes that to find_package_handle_standard_args to show which version
was found.
But it did not set a ${PACKAGE_NAME}_VERSION variable, which means
we didn't record the version in qt_find_package, and thus in the final
SBOM.

Make sure we set the variable.

Amends 7ad8c347feb5e336c3833d6d3ac021a0a14b714a

Change-Id: Ia0d5b895de36017949e6607d17093459dca302b3
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0be79f14865c0a19fde0abad7d1722f0bac3b7c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2024-06-10 13:36:32 +02:00 committed by Qt Cherry-pick Bot
parent a70a587f61
commit 19c4c8e12d

View File

@ -102,8 +102,11 @@ macro(qt_find_package_system_or_bundled _unique_prefix)
endif() endif()
if(_qfwrap_${_unique_prefix}_package_version) if(_qfwrap_${_unique_prefix}_package_version)
set(Wrap${_qfwrap_${_unique_prefix}_FRIENDLY_PACKAGE_NAME}_VERSION
"${_qfwrap_${_unique_prefix}_package_version}"
)
set(_qfwrap_${_unique_prefix}_package_version_option set(_qfwrap_${_unique_prefix}_package_version_option
VERSION_VAR "_qfwrap_${_unique_prefix}_package_version" VERSION_VAR "Wrap${_qfwrap_${_unique_prefix}_FRIENDLY_PACKAGE_NAME}_VERSION"
) )
endif() endif()