CMake: Include license and license file attribution in SBOM comment

Some attribution entries don't have a SPDX license id specified, in
that case it's good to at least include the free-form license name and
file path.

Pick-to: 6.8 6.9
Task-number: QTBUG-122899
Change-Id: I75bb5c30645684ea74fe94da92ea30eb29965ad4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Alexandru Croitor 2025-02-27 15:43:08 +01:00
parent e5f79573fe
commit cf9f09cd60
2 changed files with 10 additions and 3 deletions

View File

@ -415,11 +415,10 @@ function(_qt_internal_sbom_read_qt_attribution out_prefix)
endif()
if(arg_GET_DEFAULT_KEYS)
# Some calls are currently commented out, to save on json parsing time because we don't have
# a usage for them yet.
# _qt_internal_sbom_get_attribution_key(License license)
_qt_internal_sbom_get_attribution_key(Id attribution_id "${out_prefix}")
_qt_internal_sbom_get_attribution_key(LicenseId license_id "${out_prefix}")
_qt_internal_sbom_get_attribution_key(License license "${out_prefix}")
_qt_internal_sbom_get_attribution_key(LicenseFile license_file "${out_prefix}")
_qt_internal_sbom_get_attribution_key(Version version "${out_prefix}")
_qt_internal_sbom_get_attribution_key(Homepage homepage "${out_prefix}")
_qt_internal_sbom_get_attribution_key(Name attribution_name "${out_prefix}")

View File

@ -996,6 +996,14 @@ function(_qt_internal_sbom_add_target target)
if(qa_qt_usage)
string(APPEND package_comment " Qt usage: ${qa_qt_usage}\n")
endif()
if(qa_license)
string(APPEND package_comment " License: ${qa_license}\n")
endif()
if(qa_license_file)
string(APPEND package_comment " License file: ${qa_license_file}\n")
endif()
endif()
if(package_comment)