From a51b926856a0df8feeada60fe2512f9b1a1e92a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timo=20R=C3=B6hling?= Date: Sat, 23 Oct 2021 19:20:10 +0200 Subject: [PATCH] Fix list_licenses macro Gbp-Pq: Name 0005-Fix-list_licenses-macro.patch --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6786b22..8d674dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -475,11 +475,13 @@ function(list_licenses OUTPUT MODULES) foreach(module ${_MODULES}) set(license_path "../../third_party/${module}/LICENSE") get_filename_component(fullname "${license_path}" ABSOLUTE) - string(APPEND CONTENT "${STR_OPENER}License and copyrights for ${module}:\n${STR_CLOSER},\n") - file(READ ${license_path} license_long) - string(REPLACE "\n" "${STR_CLOSER},\n${STR_OPENER}" license ${license_long}) - string(APPEND CONTENT ${STR_OPENER}${license}\n${STR_CLOSER},) - string(APPEND CONTENT "\n\n") + if(EXISTS ${license_path}) + string(APPEND CONTENT "${STR_OPENER}License and copyrights for ${module}:\n${STR_CLOSER},\n") + file(READ ${license_path} license_long) + string(REPLACE "\n" "${STR_CLOSER},\n${STR_OPENER}" license ${license_long}) + string(APPEND CONTENT ${STR_OPENER}${license}\n${STR_CLOSER},) + string(APPEND CONTENT "\n\n") + endif() endforeach() configure_file(${FILAMENT}/build/licenses.inc.in ${OUTPUT}) endfunction(list_licenses) -- 2.30.2