Windows: Work around CMake not finding libarchive's include directory because MSYS2 CMake doesn't like UNIX paths.

This commit is contained in:
Nadia Holmquist Pedersen 2024-04-18 12:25:41 +02:00
parent 84474105e2
commit ba8d547dfa
1 changed files with 7 additions and 0 deletions

View File

@ -19,6 +19,13 @@ function(fix_interface_includes)
if (PARENT_DIR MATCHES "include$") if (PARENT_DIR MATCHES "include$")
list(APPEND NEW_DIRS "${PARENT_DIR}") list(APPEND NEW_DIRS "${PARENT_DIR}")
endif() 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() endforeach()
list(APPEND DIRS ${NEW_DIRS}) list(APPEND DIRS ${NEW_DIRS})