Explorar el Código

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.
Tobias Rittig, Ph.D. hace 11 meses
padre
commit
f69e55058d
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      code/CMakeLists.txt

+ 4 - 1
code/CMakeLists.txt

@@ -1053,7 +1053,7 @@ ENDIF() # IF (ASSIMP_BUILD_USD_IMPORTER)
 IF(ASSIMP_HUNTER_ENABLED)
 IF(ASSIMP_HUNTER_ENABLED)
   hunter_add_package(pugixml)
   hunter_add_package(pugixml)
   find_package(pugixml CONFIG REQUIRED)
   find_package(pugixml CONFIG REQUIRED)
-ELSE()
+ELSEIF(NOT TARGET pugixml::pugixml)
   SET( Pugixml_SRCS
   SET( Pugixml_SRCS
     ../contrib/pugixml/src/pugiconfig.hpp
     ../contrib/pugixml/src/pugiconfig.hpp
     ../contrib/pugixml/src/pugixml.hpp
     ../contrib/pugixml/src/pugixml.hpp
@@ -1439,6 +1439,9 @@ ELSE()
   if (ASSIMP_BUILD_DRACO)
   if (ASSIMP_BUILD_DRACO)
     target_link_libraries(assimp ${draco_LIBRARIES})
     target_link_libraries(assimp ${draco_LIBRARIES})
   endif()
   endif()
+  if(TARGET pugixml::pugixml)
+    target_link_libraries(assimp pugixml::pugixml)
+  endif()
 ENDIF()
 ENDIF()
 
 
 if(ASSIMP_ANDROID_JNIIOSYSTEM)
 if(ASSIMP_ANDROID_JNIIOSYSTEM)