diff options
author | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2024-04-18 12:25:41 +0200 |
---|---|---|
committer | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2024-04-18 12:25:41 +0200 |
commit | ba8d547dfa81539f4e8474152d92e866ad89241b (patch) | |
tree | 163d580960ef57f128d023bccb47c9e6f91d045c | |
parent | 84474105e29c858bdfe22fcbe443ede7753e9609 (diff) |
Windows: Work around CMake not finding libarchive's include directory because MSYS2 CMake doesn't like UNIX paths.
-rw-r--r-- | cmake/FixInterfaceIncludes.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/FixInterfaceIncludes.cmake b/cmake/FixInterfaceIncludes.cmake index 513c111..5c285d7 100644 --- a/cmake/FixInterfaceIncludes.cmake +++ b/cmake/FixInterfaceIncludes.cmake @@ -19,6 +19,13 @@ function(fix_interface_includes) if (PARENT_DIR MATCHES "include$") list(APPEND NEW_DIRS "${PARENT_DIR}") endif() + + # HACK + # The libarchive pkg-config file in MSYS2 seems to include a UNIX-style path for its + # include directory and CMake doesn't like that. + if (WIN32 AND MINGW AND target STREQUAL PkgConfig::LibArchive) + list(FILTER DIRS EXCLUDE REGEX "^/[^.]+64/.*") + endif() endforeach() list(APPEND DIRS ${NEW_DIRS}) |