diff --git a/scripts/pugixml-config.cmake.in b/scripts/pugixml-config.cmake.in index d9db8146e5341dc00cea44d4662df7b49118cba8..d4282f97db30ddae2b9b32fa8ef8b0c82ec51364 100644 --- a/scripts/pugixml-config.cmake.in +++ b/scripts/pugixml-config.cmake.in @@ -5,7 +5,7 @@ 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") +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)