Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions cmakelib/QuickCppLibUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,8 @@ endfunction()

# Emulate list(FILTER list INCLUDE|EXCLUDE REGEX regex) on cmake < 3.6
function(list_filter listname op regexqualifer regex)
if(CMAKE_VERSION VERSION_GREATER 3.59)
list(FILTER ${ARGV})
else()
set(out)
foreach(item ${${listname}})
string(REGEX MATCH "${regex}" match ${item})
if("${op}" STREQUAL "INCLUDE")
if(match)
list(APPEND out ${item})
endif()
else()
if(NOT match)
list(APPEND out ${item})
endif()
endif()
endforeach()
set(${listname} ${out} PARENT_SCOPE)
endif()
list(FILTER ${ARGV})
set(${listname} ${${listname}} PARENT_SCOPE)
endfunction()

# Escape a string into a regex matching that string
Expand Down
Loading