Skip to content

Commit e3cb695

Browse files
author
jyu49
committed
remove judgement, only use cmake function
1 parent e62d39d commit e3cb695

1 file changed

Lines changed: 2 additions & 19 deletions

File tree

cmakelib/QuickCppLibUtils.cmake

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,8 @@ endfunction()
5353

5454
# Emulate list(FILTER list INCLUDE|EXCLUDE REGEX regex) on cmake < 3.6
5555
function(list_filter listname op regexqualifer regex)
56-
if(CMAKE_VERSION VERSION_GREATER 3.59)
57-
list(FILTER ${ARGV})
58-
set(${listname} ${${listname}} PARENT_SCOPE)
59-
else()
60-
set(out)
61-
foreach(item ${${listname}})
62-
string(REGEX MATCH "${regex}" match ${item})
63-
if("${op}" STREQUAL "INCLUDE")
64-
if(match)
65-
list(APPEND out ${item})
66-
endif()
67-
else()
68-
if(NOT match)
69-
list(APPEND out ${item})
70-
endif()
71-
endif()
72-
endforeach()
73-
set(${listname} ${out} PARENT_SCOPE)
74-
endif()
56+
list(FILTER ${ARGV})
57+
set(${listname} ${${listname}} PARENT_SCOPE)
7558
endfunction()
7659

7760
# Escape a string into a regex matching that string

0 commit comments

Comments
 (0)