Allow usage of mirrors for all dependencies
This commit is contained in:
13
cmake/VarsFromFile.cmake
Normal file
13
cmake/VarsFromFile.cmake
Normal file
@@ -0,0 +1,13 @@
|
||||
function(VarsFromFile filename)
|
||||
file(STRINGS ${filename} ConfigContents)
|
||||
foreach(NameAndValue ${ConfigContents})
|
||||
# Strip leading spaces
|
||||
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
|
||||
# Find variable name
|
||||
string(REGEX MATCH "^[^=]+" Name ${NameAndValue})
|
||||
# Find the value
|
||||
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
||||
# Set the variable
|
||||
set(${Name} "${Value}" PARENT_SCOPE)
|
||||
endforeach()
|
||||
endfunction(VarsFromFile)
|
||||
Reference in New Issue
Block a user