Only try to read file if it exists

This commit is contained in:
2024-05-22 12:19:45 +02:00
parent d896e8f29a
commit 4f539e786c

View File

@@ -1,4 +1,5 @@
function(VarsFromFile filename)
if (EXISTS ${filename})
file(STRINGS ${filename} ConfigContents)
foreach(NameAndValue ${ConfigContents})
# Strip leading spaces
@@ -10,4 +11,5 @@ function(VarsFromFile filename)
# Set the variable
set(${Name} "${Value}" PARENT_SCOPE)
endforeach()
endif ()
endfunction(VarsFromFile)