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 <joerg.bornemann@qt.io>
(cherry picked from commit 3a5c62d4af9cb07fba065de8a2d1b97531b6fd30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2025-01-31 16:05:25 +01:00 committed by Qt Cherry-pick Bot
parent 81b3e80840
commit 90b128e4cc

View File

@ -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()