From ad2547992fbcc52fdfce448cd3732658ab8631be Mon Sep 17 00:00:00 2001 From: Clifford Yapp <238416+starseeker@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:25:02 -0400 Subject: [PATCH] Add pugixml find_package calls to support assimp. --- src/libgcv/plugins/assetimport/CMakeLists.txt | 4 +++- src/libged/facetize/CMakeLists.txt | 9 ++++----- src/libged/facetize/subprocess/CMakeLists.txt | 7 ++++--- src/librt/CMakeLists.txt | 7 ++++--- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/libgcv/plugins/assetimport/CMakeLists.txt b/src/libgcv/plugins/assetimport/CMakeLists.txt index 7b3835a0f4..4a1f36647e 100644 --- a/src/libgcv/plugins/assetimport/CMakeLists.txt +++ b/src/libgcv/plugins/assetimport/CMakeLists.txt @@ -1,9 +1,10 @@ set(ASSETIMPORT_SRCS assetimport_read.cpp assetimport_write.cpp) +brlcad_find_package(pugixml) brlcad_find_package(assimp) if(BRLCAD_ENABLE_ASSETIMPORT) - if(TARGET assimp::assimp) + if(TARGET assimp::assimp AND TARGET pugixml::pugixml) gcv_plugin_library(gcv-assetimport SHARED ${ASSETIMPORT_SRCS}) target_link_libraries( gcv-assetimport @@ -12,6 +13,7 @@ if(BRLCAD_ENABLE_ASSETIMPORT) librt libbu assimp::assimp + pugixml::pugixml ) set_property(TARGET gcv-assetimport APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD HAVE_CONFIG_H) validate_style(gcv-assetimport "${ASSETIMPORT_SRCS}") diff --git a/src/libged/facetize/CMakeLists.txt b/src/libged/facetize/CMakeLists.txt index 403c410843..709685859c 100644 --- a/src/libged/facetize/CMakeLists.txt +++ b/src/libged/facetize/CMakeLists.txt @@ -1,7 +1,6 @@ brlcad_find_package(MANIFOLD REQUIRED) -message("starting") +brlcad_find_package(pugixml) brlcad_find_package(assimp) -message("done") set(FACETIZE_LOCAL_INCLUDE_DIRS) @@ -9,10 +8,10 @@ if(MANIFOLD_LIBRARIES) list(APPEND FACETIZE_LOCAL_INCLUDE_DIRS ${MANIFOLD_INCLUDE_DIRS}) add_definitions(-DUSE_MANIFOLD) - if(TARGET assimp::assimp) - set(ASSETIMPORT_LIBRARIES assimp::assimp) + if(TARGET assimp::assimp AND TARGET pugixml::pugixml) + set(ASSETIMPORT_LIBRARIES assimp::assimp pugixml::pugixml) add_definitions(-DUSE_ASSETIMPORT) - endif(ASSETIMPORT_LIBRARY) + endif(TARGET assimp::assimp AND TARGET pugixml::pugixml) endif(MANIFOLD_LIBRARIES) set(FACETIZE_LIBS libged libbu ${MANIFOLD_LIBRARIES} ${ASSETIMPORT_LIBRARIES}) diff --git a/src/libged/facetize/subprocess/CMakeLists.txt b/src/libged/facetize/subprocess/CMakeLists.txt index 38e83c663c..271a7df2ef 100644 --- a/src/libged/facetize/subprocess/CMakeLists.txt +++ b/src/libged/facetize/subprocess/CMakeLists.txt @@ -12,11 +12,12 @@ set( brlcad_find_package(MANIFOLD REQUIRED) +brlcad_find_package(pugixml) brlcad_find_package(assimp) -if(TARGET assimp::assimp) +if(TARGET assimp::assimp AND TARGET pugixml::pugixml) add_definitions(-DUSE_ASSETIMPORT) - set(ASSETIMPORT_LIBRARIES assimp::assimp) -endif(ASSETIMPORT_LIBRARIES) + set(ASSETIMPORT_LIBRARIES assimp::assimp pugixml::pugixml) +endif(TARGET assimp::assimp AND TARGET pugixml::pugixml) brlcad_find_package(GEOGRAM REQUIRED SYSPATTERN geogram) add_definitions(-DUSE_GEOGRAM) diff --git a/src/librt/CMakeLists.txt b/src/librt/CMakeLists.txt index 535254ab05..8e83b7766f 100644 --- a/src/librt/CMakeLists.txt +++ b/src/librt/CMakeLists.txt @@ -6,15 +6,16 @@ if(BRLCAD_ENABLE_ASSETIMPORT) # Manifold's assimp integration is convenient for producing glb files, which # are needed if we're going to submit problem cases upstream, but using it # introduces an additional large dependency just for a debugging output... + brlcad_find_package(pugixml) brlcad_find_package(assimp) endif(BRLCAD_ENABLE_ASSETIMPORT) brlcad_find_package(GEOGRAM REQUIRED SYSPATTERN geogram) add_definitions(-DUSE_GEOGRAM) -if(TARGET assimp::assimp) +if(TARGET assimp::assimp AND TARGET pugixml::pugixml) add_definitions(-DUSE_ASSETIMPORT) - set(ASSETIMPORT_LIBRARIES assimp::assimp) -endif(TARGET assimp::assimp) + set(ASSETIMPORT_LIBRARIES assimp::assimp pugixml::pugixml) +endif(TARGET assimp::assimp AND TARGET pugixml::pugixml) if(NOT BRLCAD_ENABLE_GCT) brlcad_find_package(MMESH REQUIRED)