diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2020-12-02 17:13:35 -0500 |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2020-12-02 17:16:47 -0500 |
commit | 5063e874999ccbc47ebfba0ea4c868b77d23ae4b (patch) | |
tree | 1a8b004df76f54f8af5b14eb17f4e31c8ae1fd02 | |
parent | 7a9da11d8b2b2f06c0904d397864f216bd7c1e14 (diff) | |
download | pugixml-5063e874999ccbc47ebfba0ea4c868b77d23ae4b.zip pugixml-5063e874999ccbc47ebfba0ea4c868b77d23ae4b.tar.gz pugixml-5063e874999ccbc47ebfba0ea4c868b77d23ae4b.tar.bz2 |
cmake: provide a compatibility target for users
For users using older pugixml releases, add an ALIAS target which works
with the new versions too.
-rw-r--r-- | scripts/pugixml-config.cmake.in | 7 |
1 files changed, 7 insertions, 0 deletions
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 () |