From 19c4c8e12d4d7f0754fb115f33c78ff78f193d43 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 10 Jun 2024 13:36:32 +0200 Subject: [PATCH] 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 (cherry picked from commit 0be79f14865c0a19fde0abad7d1722f0bac3b7c2) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtFindWrapHelper.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/QtFindWrapHelper.cmake b/cmake/QtFindWrapHelper.cmake index b17f2133bba..506bfc7fadb 100644 --- a/cmake/QtFindWrapHelper.cmake +++ b/cmake/QtFindWrapHelper.cmake @@ -102,8 +102,11 @@ macro(qt_find_package_system_or_bundled _unique_prefix) endif() 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 - VERSION_VAR "_qfwrap_${_unique_prefix}_package_version" + VERSION_VAR "Wrap${_qfwrap_${_unique_prefix}_FRIENDLY_PACKAGE_NAME}_VERSION" ) endif()