mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-27 13:33:17 +08:00
06868c8f57
This fixes duplicate target definition errors when find_package(pugixml) is called twice in a build. Fixes #393.
13 lines
579 B
CMake
13 lines
579 B
CMake
@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 TARGET pugixml AND (NOT DEFINED PACKAGE_FIND_VERSION OR PACKAGE_FIND_VERSION VERSION_LESS "1.11"))
|
|
add_library(pugixml INTERFACE IMPORTED)
|
|
# Equivalent to target_link_libraries INTERFACE, but compatible with CMake 3.10
|
|
set_target_properties(pugixml PROPERTIES INTERFACE_LINK_LIBRARIES pugixml::pugixml)
|
|
endif ()
|