diff options
| author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2022-11-05 22:11:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-05 22:11:22 +0100 |
| commit | 01ff681f571887fe3ffce90e0df60cf1997e9980 (patch) | |
| tree | 246ca6b25bc661754971220e5964cb8a885eff5e /cmake | |
| parent | 5723b19210b2f3c8f0f20fce541c85b0739c7a3d (diff) | |
| parent | 502b5ee10fedc97e1455e7365a10c9bad7268c67 (diff) | |
| download | rneovim-01ff681f571887fe3ffce90e0df60cf1997e9980.tar.gz rneovim-01ff681f571887fe3ffce90e0df60cf1997e9980.tar.bz2 rneovim-01ff681f571887fe3ffce90e0df60cf1997e9980.zip | |
Merge pull request #20858 from dundargoc/build/lintsh
build: add more shell scripts to the `lintsh` target
Diffstat (limited to 'cmake')
| -rw-r--r-- | cmake/Util.cmake | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/cmake/Util.cmake b/cmake/Util.cmake index 343a729305..a86ced89d6 100644 --- a/cmake/Util.cmake +++ b/cmake/Util.cmake @@ -49,12 +49,13 @@ # simple be added to FILES # GLOB_DIRS - The directories to recursively search for files with extension # GLOB_PAT -# -function(add_glob_targets) +# EXCLUDE - List of paths to skip (regex). Works on both directories and +# files. +function(add_glob_target) cmake_parse_arguments(ARG "REQUIRED" "TARGET;COMMAND;GLOB_PAT;TOUCH_STRATEGY" - "FLAGS;FILES;GLOB_DIRS" + "FLAGS;FILES;GLOB_DIRS;EXCLUDE" ${ARGN} ) @@ -72,7 +73,15 @@ function(add_glob_targets) endif() foreach(gd ${ARG_GLOB_DIRS}) - file(GLOB_RECURSE globfiles ${PROJECT_SOURCE_DIR}/${gd}/${ARG_GLOB_PAT}) + file(GLOB_RECURSE globfiles_unnormalized ${PROJECT_SOURCE_DIR}/${gd}/${ARG_GLOB_PAT}) + set(globfiles) + foreach(f ${globfiles_unnormalized}) + file(TO_CMAKE_PATH "${f}" f) + list(APPEND globfiles ${f}) + endforeach() + foreach(exclude_pattern ${ARG_EXCLUDE}) + list(FILTER globfiles EXCLUDE REGEX ${exclude_pattern}) + endforeach() list(APPEND ARG_FILES ${globfiles}) endforeach() |