summaryrefslogtreecommitdiffstats
path: root/Modules/GetPrerequisites.cmake
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2019-05-09 20:51:55 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2019-05-23 13:15:04 (GMT)
commit3dfc8b9bd6b75d35b959ee4a79c056f4af8ea28a (patch)
tree82590eaeb3214bc99639b9ef928498c84b7aad3e /Modules/GetPrerequisites.cmake
parenta4faf7788cc40b17c48a9393cd15425ee65abfd9 (diff)
downloadCMake-3dfc8b9bd6b75d35b959ee4a79c056f4af8ea28a.zip
CMake-3dfc8b9bd6b75d35b959ee4a79c056f4af8ea28a.tar.gz
CMake-3dfc8b9bd6b75d35b959ee4a79c056f4af8ea28a.tar.bz2
GetPrerequisites: use if(IN_LIST) instead of foreach
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-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)