Add `META_TIDY_EXCLUDE_REGEX` to exclude files from tidy target

This can be useful to exclude 3rd party files.
This commit is contained in:
Martchus 2021-08-02 16:49:37 +02:00
parent 2de07d4cd0
commit 8961cf3a32
1 changed files with 3 additions and 0 deletions

View File

@ -328,6 +328,9 @@ set(FORMATABLE_FILES
# only format C/C++ files (and not eg. QML files)
if (FORMATABLE_FILES)
list(FILTER FORMATABLE_FILES INCLUDE REGEX ".*\\.(c|cc|cpp|h|hh|hpp)")
if (FORMATABLE_FILES AND META_TIDY_EXCLUDE_REGEX)
list(FILTER FORMATABLE_FILES EXCLUDE REGEX "${META_TIDY_EXCLUDE_REGEX}")
endif ()
endif ()
# determine source files which might be passed to cmake-format