From 8d8cf0bbfe931159965e6f6175c8728ee61e23a7 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 24 Feb 2025 18:07:22 +0100 Subject: [PATCH] CMake: Re-order SBOM embedded qt_attribution.json fields Put the attribution file path and entry first, followed by the id, and the rest of the fields. Pick-to: 6.8 Task-number: QTBUG-122899 Change-Id: I478a48980e6207646189d6b80ec57dbc9efb4902 Reviewed-by: Joerg Bornemann Reviewed-by: Alexey Edelev (cherry picked from commit a5c7eb97ceb19ac90f8117240ad04cc717803555) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtPublicSbomHelpers.cmake | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/cmake/QtPublicSbomHelpers.cmake b/cmake/QtPublicSbomHelpers.cmake index 32777438a25..dd93b4336d1 100644 --- a/cmake/QtPublicSbomHelpers.cmake +++ b/cmake/QtPublicSbomHelpers.cmake @@ -967,18 +967,6 @@ function(_qt_internal_sbom_add_target target) endif() if(arg_USE_ATTRIBUTION_FILES) - if(qa_attribution_name) - string(APPEND package_comment " Name: ${qa_attribution_name}\n") - endif() - - if(qa_description) - string(APPEND package_comment " Description: ${qa_description}\n") - endif() - - if(qa_qt_usage) - string(APPEND package_comment " Qt usage: ${qa_qt_usage}\n") - endif() - if(qa_chosen_attribution_file_path) _qt_internal_sbom_map_path_to_reproducible_relative_path(relative_attribution_path PATH "${qa_chosen_attribution_file_path}" @@ -991,6 +979,22 @@ function(_qt_internal_sbom_add_target target) string(APPEND package_comment " Entry index: ${qa_chosen_attribution_entry_index}\n") endif() + + if(qa_attribution_id) + string(APPEND package_comment " Id: ${qa_attribution_id}\n") + endif() + + if(qa_attribution_name) + string(APPEND package_comment " Name: ${qa_attribution_name}\n") + endif() + + if(qa_description) + string(APPEND package_comment " Description: ${qa_description}\n") + endif() + + if(qa_qt_usage) + string(APPEND package_comment " Qt usage: ${qa_qt_usage}\n") + endif() endif() if(package_comment)