mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
cmake: tidy-up foreach()
syntax
Use `IN LISTS` and `IN ITEMS`. This appears to be the preferred way within CMake's own source code and possibly improves readability. Fixup a side-effect of `IN LISTS`, where it retains empty values at the end of the list, as opposed to the syntax used before, which dropped it. In our case this happened with lines read from a text file via `file(READ)`. https://cmake.org/cmake/help/v3.7/command/foreach.html Closes #1180
This commit is contained in:
@ -65,7 +65,7 @@ function(check_function_exists_may_need_library function variable)
|
||||
check_function_exists(${function} ${variable})
|
||||
|
||||
if(NOT ${variable})
|
||||
foreach(lib ${ARGN})
|
||||
foreach(lib IN LISTS ARGN)
|
||||
string(TOUPPER ${lib} UP_LIB)
|
||||
# Use new variable to prevent cache from previous step shortcircuiting
|
||||
# new test
|
||||
|
Reference in New Issue
Block a user