From 195f53eeaad55567fd0a439726ab363ca628a2e9 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 3 Jan 2025 16:32:42 +0100 Subject: [PATCH] CMake: Handle DESTDIR for SBOM doc references in top-level builds When installing a top-level build using the DESTDIR env var mechanism, the SBOM generation process could not find the qtbase sbom document, while generating the qtshadertools document. Make sure to prepend the DESTDIR env var to the install-time install prefix, when looking for external SBOM documents. Fixes: QTBUG-132188 Change-Id: I1cdb75842fc552b43d982f05444b5ddc1fe58595 Reviewed-by: Alexey Edelev (cherry picked from commit f2ce68d8f31f4c90471183d66075bd6fd5955d6a) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 0e14e9042d5f9237cff14584b7a3c814535a5544) --- cmake/QtPublicSbomGenerationHelpers.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtPublicSbomGenerationHelpers.cmake b/cmake/QtPublicSbomGenerationHelpers.cmake index da59482a72f..81df60c16c4 100644 --- a/cmake/QtPublicSbomGenerationHelpers.cmake +++ b/cmake/QtPublicSbomGenerationHelpers.cmake @@ -751,7 +751,7 @@ function(_qt_internal_sbom_generate_add_external_reference) # Always append the install time install prefix. # The variable is escaped, so it is evaluated during cmake install time, so that the value # can be overridden with cmake --install . --prefix . - list(APPEND install_prefixes "\${CMAKE_INSTALL_PREFIX}") + list(APPEND install_prefixes "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}") if(arg_INSTALL_PREFIXES) list(APPEND install_prefixes ${arg_INSTALL_PREFIXES})