cmake: avoid string(SUBSTRING) on short strings
CMake 3.1 and older throws an error when the input string is too shortmain
parent
607ddd0e10
commit
62297e7da5
|
@ -78,8 +78,7 @@ function(listtostr LIST OUTPUT)
|
||||||
# Do not use string(REPLACE ";" " ") here to avoid messing up list entries
|
# Do not use string(REPLACE ";" " ") here to avoid messing up list entries
|
||||||
set(res)
|
set(res)
|
||||||
foreach(ITEM ${${LIST}})
|
foreach(ITEM ${${LIST}})
|
||||||
string(SUBSTRING "${ITEM}" 0 6 start)
|
if(ITEM MATCHES "^SHELL:")
|
||||||
if(start STREQUAL "SHELL:")
|
|
||||||
string(SUBSTRING "${ITEM}" 6 -1 ITEM)
|
string(SUBSTRING "${ITEM}" 6 -1 ITEM)
|
||||||
endif()
|
endif()
|
||||||
if(ITEM)
|
if(ITEM)
|
||||||
|
|
Loading…
Reference in New Issue