Skip to content

Use all interface include dirs needed for LibXml2 (unbreak Windows build)

LIBXML2_INCLUDE_DIRS instead of LIBXML2_INCLUDE_DIR has all the needed include dirs also of other libraries in the public interface. iconv.h as used by libxml/encoding.h was not found on Windows due to that.

As CMake 3.16 is the min required version meanwhile, also resolve the existing TODO and switch to the imported target LibXml2::LibXml2, which has the DIRS variant set in the link interface property.

4579c42b had removed linking to Boost, which seems to have injected before the needed include dir to also enable libxml to find iconv.h. Without that things failed on windows:

17:17:23  C:\Craft\CI-Qt515\windows-msvc2019_64-cl-debug\include\libxml2\libxml/encoding.h(28): fatal error C1083: Cannot open include file: 'iconv.h': No such file or directory

see https://build.kde.org/job/Applications/job/akonadi/job/kf5-qt5%20WindowsMSVCQt5.15/286/changes#4579c42b48d2410101b7517552e7960dea372ae7

@mlaurent @bcooksley @carlschwan @clau-cambra

Edited by Friedrich W. H. Kossebau

Merge request reports