From f69e55058d044aca5f290aa6f29b6e8736c80816 Mon Sep 17 00:00:00 2001 From: "Tobias Rittig, Ph.D." Date: Tue, 3 Sep 2024 21:45:30 +0200 Subject: [PATCH] Allow usage of pugixml from a superproject (#5752) When using CMake subprojects with an existing build of pugixml this prevents Assimp from using its own copy. --- code/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 9b2708623..fb0fbc742 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -1053,7 +1053,7 @@ ENDIF() # IF (ASSIMP_BUILD_USD_IMPORTER) IF(ASSIMP_HUNTER_ENABLED) hunter_add_package(pugixml) find_package(pugixml CONFIG REQUIRED) -ELSE() +ELSEIF(NOT TARGET pugixml::pugixml) SET( Pugixml_SRCS ../contrib/pugixml/src/pugiconfig.hpp ../contrib/pugixml/src/pugixml.hpp @@ -1439,6 +1439,9 @@ ELSE() if (ASSIMP_BUILD_DRACO) target_link_libraries(assimp ${draco_LIBRARIES}) endif() + if(TARGET pugixml::pugixml) + target_link_libraries(assimp pugixml::pugixml) + endif() ENDIF() if(ASSIMP_ANDROID_JNIIOSYSTEM)