From 90b128e4cc7be623c67bd02128bf82a26efe2b57 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 31 Jan 2025 16:05:25 +0100 Subject: [PATCH] CMake: Fix location of build time sboms in no-prefix builds For build time sboms to be found in a no-prefix qt build of a repo, specifically when finding external sbom documents, the build time sboms have to be in the same location. Previously they were in each repo's build dir. Align the location to be in the qtbase build dir, just like for super builds. Also check for QT_BUILDING_QT because we don't want to apply the logic for QT_WILL_INSTALL not being set in user projects. Pick-to: 6.8 Task-number: QTBUG-122899 Change-Id: I04a066fc0efc91a4f2ee938c190b8632c8c946aa Reviewed-by: Joerg Bornemann (cherry picked from commit 3a5c62d4af9cb07fba065de8a2d1b97531b6fd30) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtPublicSbomGenerationHelpers.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/QtPublicSbomGenerationHelpers.cmake b/cmake/QtPublicSbomGenerationHelpers.cmake index 4ad216dee30..501ad685cd2 100644 --- a/cmake/QtPublicSbomGenerationHelpers.cmake +++ b/cmake/QtPublicSbomGenerationHelpers.cmake @@ -213,9 +213,10 @@ Relationship: SPDXRef-DOCUMENT DESCRIBES ${project_spdx_id} set(computed_sbom_file_name_without_ext "${output_file_name_without_ext}${multi_config_suffix}") set(computed_sbom_file_name "${output_file_name_without_ext}${output_file_ext}") - # In a super build, put all the build time sboms into the same dir in qtbase. - if(QT_SUPERBUILD) - set(build_sbom_root_dir "${QtBase_BINARY_DIR}/qt_sbom") + # In a super build and in a no-prefix build, put all the build time sboms into the same dir in, + # in the qtbase build dir. + if(QT_BUILDING_QT AND (QT_SUPERBUILD OR (NOT QT_WILL_INSTALL))) + set(build_sbom_root_dir "${QT_BUILD_DIR}") else() set(build_sbom_root_dir "${sbom_dir}") endif()