From d704b27e81f481db3eea9f154d07fc3a64820970 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Fri, 23 Sep 2022 17:51:01 +0200 Subject: [PATCH] cmake: Exclude empty directories due to headers install This followed some pointers from here and opted for explicit exclusion: https://stackoverflow.com/questions/55451084/cmake-files-matching-pattern-copies-empty-directories Fixes #2422 --- src/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b115055e08..8ab1d85a4b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -584,6 +584,12 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ PATTERN "3rdparty/*" EXCLUDE # The "zeek -> ." symlink isn't needed in the install-tree REGEX "^${escaped_path}$" EXCLUDE + + # FILES_MATCHING creates empty directories: + # https://gitlab.kitware.com/cmake/cmake/-/issues/17122 + # Exclude the ones that this affects explicitly. + PATTERN "script_opt/CPP/maint" EXCLUDE + PATTERN "fuzzers/corpora" EXCLUDE ) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/