Only try to read file if it exists
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
function(VarsFromFile filename)
|
function(VarsFromFile filename)
|
||||||
|
if (EXISTS ${filename})
|
||||||
file(STRINGS ${filename} ConfigContents)
|
file(STRINGS ${filename} ConfigContents)
|
||||||
foreach(NameAndValue ${ConfigContents})
|
foreach(NameAndValue ${ConfigContents})
|
||||||
# Strip leading spaces
|
# Strip leading spaces
|
||||||
@@ -10,4 +11,5 @@ function(VarsFromFile filename)
|
|||||||
# Set the variable
|
# Set the variable
|
||||||
set(${Name} "${Value}" PARENT_SCOPE)
|
set(${Name} "${Value}" PARENT_SCOPE)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
endif ()
|
||||||
endfunction(VarsFromFile)
|
endfunction(VarsFromFile)
|
||||||
Reference in New Issue
Block a user