Commit 3dfc8b9b authored by Ben Boeckel's avatar Ben Boeckel
Browse files

GetPrerequisites: use if(IN_LIST) instead of foreach

parent a4faf778
......@@ -169,17 +169,11 @@ Possible types are:
other
#]=======================================================================]
function(gp_append_unique list_var value)
set(contains 0)
foreach(item ${${list_var}})
if(item STREQUAL "${value}")
set(contains 1)
break()
endif()
endforeach()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
if(NOT contains)
function(gp_append_unique list_var value)
if(NOT item IN_LIST ${list_var})
set(${list_var} ${${list_var}} "${value}" PARENT_SCOPE)
endif()
endfunction()
......@@ -1043,3 +1037,5 @@ function(list_prerequisites_by_glob glob_arg glob_exp)
endif()
endforeach()
endfunction()
cmake_policy(POP)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment