diff options
author | Brad King <brad.king@kitware.com> | 2019-05-28 15:50:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-28 15:51:58 (GMT) |
commit | 76cb43c7c5515e0ca8c1858311a54954fbc39870 (patch) | |
tree | a202b45b515e6ce2d8b7b37bc2777879f3386efc /Modules | |
parent | da0937c04fe8cb167a55a1e37cf275d24a262fa7 (diff) | |
parent | 3dfc8b9bd6b75d35b959ee4a79c056f4af8ea28a (diff) | |
download | CMake-76cb43c7c5515e0ca8c1858311a54954fbc39870.zip CMake-76cb43c7c5515e0ca8c1858311a54954fbc39870.tar.gz CMake-76cb43c7c5515e0ca8c1858311a54954fbc39870.tar.bz2 |
Merge topic 'GetPrerequisites-use-if-IN_LIST'
3dfc8b9bd6 GetPrerequisites: use if(IN_LIST) instead of foreach
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3299
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/GetPrerequisites.cmake | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index fa6d75a..06655a4 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -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) |