Skip to content

find_package should not return system installed version if same package is installed from vcpkg #24995

@Naville

Description

@Naville

Describe the bug
find_package(libxml2) returning multiple include directory.

Environment

  • OS: macOS
  • Compiler: Any

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install libxml2
  2. find_package(libxml2) and print LIBXML2_INCLUDE_DIR
  3. Try compile any old-enough LLVM version like 11.x with Vcpkg CMake toolchain

Expected behavior
LIBXML2_INCLUDE_DIR should be, quoting CMake documentation the directory containing LibXml2 headers, it's not a plural

Failure logs

-- Found libtool - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
CMake Error at cmake/config-ix.cmake:158 (if):
  if given arguments:

    "(" "CMAKE_OSX_SYSROOT" ")" "AND" "(" "EXISTS" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk//Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/libxml2" "/Users/naville/Build/sysroot/installed/x64-osx/include" ")"

  Unknown arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:617 (include)

Additional context
See comments below

Metadata

Metadata

Assignees

Labels

category:port-bugThe issue is with a library, which is something the port should already support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions