Skip to content

Commit 7537bfb

Browse files
semlanikQt Cherry-pick Bot
authored and
Qt Cherry-pick Bot
committed
CMake: Fix SBOM PROJECT_COMMENT CMP0174 related warning
We should only pass PROJECT_COMMENT if it has a value. We also need to escape semicolons, because the project comment might contain the qt configure line, and that might have passed arguments like -qpa offscreen\;xcb Pick-to: 6.8 Change-Id: I934cf75c376b3466ba91a433d009e6eaa77a60fa Reviewed-by: Alexey Edelev <[email protected]> (cherry picked from commit ea57558) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
1 parent 72e6a5f commit 7537bfb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmake/QtPublicSbomHelpers.cmake

+7-1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ function(_qt_internal_sbom_begin_project)
214214
endif()
215215
endif()
216216

217+
if(project_comment)
218+
# Escape any potential semicolons.
219+
string(REPLACE ";" "\\;" project_comment "${project_comment}")
220+
set(project_comment PROJECT_COMMENT "${project_comment}")
221+
endif()
222+
217223
_qt_internal_sbom_begin_project_generate(
218224
OUTPUT "${repo_spdx_install_path}"
219225
OUTPUT_RELATIVE_PATH "${repo_spdx_relative_install_path}"
@@ -223,7 +229,7 @@ function(_qt_internal_sbom_begin_project)
223229
SUPPLIER_URL "${repo_supplier_url}"
224230
DOWNLOAD_LOCATION "${download_location}"
225231
PROJECT "${repo_project_name_lowercase}"
226-
PROJECT_COMMENT "${project_comment}"
232+
${project_comment}
227233
PROJECT_FOR_SPDX_ID "${repo_project_name_for_spdx_id}"
228234
NAMESPACE "${repo_spdx_namespace}"
229235
CPE "${qt_cpe}"

0 commit comments

Comments
 (0)