summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-05-28 15:50:29 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-05-28 15:51:58 (GMT)
commit76cb43c7c5515e0ca8c1858311a54954fbc39870 (patch)
treea202b45b515e6ce2d8b7b37bc2777879f3386efc /Modules
parentda0937c04fe8cb167a55a1e37cf275d24a262fa7 (diff)
parent3dfc8b9bd6b75d35b959ee4a79c056f4af8ea28a (diff)
downloadCMake-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.cmake16
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)