Cmake libxml compatibility

This commit is contained in:
Thomas Krijnen
2025-09-10 10:17:59 +02:00
parent b5275f5ab2
commit f86e5abb85
+8 -1
View File
@@ -442,7 +442,14 @@ if(NOT MINIMAL_BUILD)
clear_wasm_sysroot()
if(IFCXML_SUPPORT)
if((NOT LIBXML2_INCLUDE_DIR AND NOT LIBXML2_LIBRARIES))
find_package(LibXml2 CONFIG REQUIRED)
# First try config mode (probably works with vcpkg, Conan, macOS brew installs, but not on ubuntu 22.04?)
find_package(LibXml2 QUIET CONFIG)
if(NOT LibXml2_FOUND)
# Fallback to CMake's builtin FindLibXml2 module (works on Ubuntu)
find_package(LibXml2 REQUIRED)
endif()
message(STATUS "Found LibXml2 config: ${LibXml2_DIR}")
get_target_property(LIBXML2_INCLUDE_DIR LibXml2::LibXml2 INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(_libxml2_debug LibXml2::LibXml2 IMPORTED_LOCATION_DEBUG)