From 5063e874999ccbc47ebfba0ea4c868b77d23ae4b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 2 Dec 2020 17:13:35 -0500 Subject: [PATCH 1/2] cmake: provide a compatibility target for users For users using older pugixml releases, add an ALIAS target which works with the new versions too. --- scripts/pugixml-config.cmake.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/pugixml-config.cmake.in b/scripts/pugixml-config.cmake.in index 91e3493..5af3750 100644 --- a/scripts/pugixml-config.cmake.in +++ b/scripts/pugixml-config.cmake.in @@ -1,3 +1,10 @@ @PACKAGE_INIT@ include("${CMAKE_CURRENT_LIST_DIR}/pugixml-targets.cmake") + +# If the user is not requiring 1.11 (either by explicitly requesting an older +# version or not requesting one at all), provide the old imported target name +# for compatibility. +if (NOT DEFINED PACKAGE_FIND_VERSION OR PACKAGE_FIND_VERSION VERSION_LESS "1.11") + add_library(pugixml ALIAS pugixml::pugixml) +endif () From d1d415e6669b4e47d30ffd3f583a10e91e929310 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 2 Dec 2020 17:13:20 -0500 Subject: [PATCH 2/2] docs: add a note about the new imported target name for CMake --- docs/manual.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/manual.adoc b/docs/manual.adoc index 1f80929..5974808 100644 --- a/docs/manual.adoc +++ b/docs/manual.adoc @@ -2156,6 +2156,9 @@ Maintenance release. Changes: . Fix Wzero-as-null-pointer-constant warnings in pugixml.hpp . Work around several static analysis false positives +* Build system changes + . The CMake package for pugixml now provides a `pugixml::pugixml` target rather than a `pugixml` target. A compatibility `pugixml` target is provided if at least version 1.11 is not requested. + [[v1.10]] === v1.10 ^2019-09-15^