From d624592ca40e05033432de72e0c4d9f6570b5544 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 19 Aug 2024 18:52:45 +0200 Subject: [PATCH] CMake: Don't forward FRIENDLY_PACKAGE_NAME to sub-attribution targets Instead, the package name should be determined by the sub-attribution target name. Otherwise the build system will try to generate multiple files with the same name, but different content. Amends 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13 Pick-to: 6.8 Task-number: QTBUG-122899 Change-Id: I10b4ec2fe8f38d70d13918dc980d1bd1d9145cb6 Reviewed-by: Alexey Edelev --- cmake/QtPublicSbomHelpers.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/QtPublicSbomHelpers.cmake b/cmake/QtPublicSbomHelpers.cmake index 18722bc0dcb..e3634afd4f4 100644 --- a/cmake/QtPublicSbomHelpers.cmake +++ b/cmake/QtPublicSbomHelpers.cmake @@ -2091,6 +2091,10 @@ function(_qt_internal_sbom_handle_qt_attribution_files out_prefix_outer) ATTRIBUTION_FILE_DIR_PATHS ) + # Also filter out the FRIENDLY_PACKAGE_NAME option, otherwise we'd try to + # file(GENERATE) multiple times with the same file name, but different content. + list(REMOVE_ITEM sbom_single_args FRIENDLY_PACKAGE_NAME) + _qt_internal_forward_function_args( FORWARD_APPEND FORWARD_PREFIX arg