From: Timo Röhling Date: Sat, 23 Oct 2021 17:20:10 +0000 (+0200) Subject: Fix list_licenses macro X-Git-Tag: archive/raspbian/1.9.25+dfsg2-6+rpi1~2^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f99bbef1a42ad4f6c02963e6ff193289efd7f8cd;p=filament.git Fix list_licenses macro Gbp-Pq: Name 0005-Fix-list_licenses-macro.patch --- 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)