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)