Skip to content

Commit

Permalink
Add pugixml find_package calls to support assimp.
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Oct 4, 2024
1 parent 6113146 commit ad25479
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion src/libgcv/plugins/assetimport/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}")
Expand Down
9 changes: 4 additions & 5 deletions src/libged/facetize/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
brlcad_find_package(MANIFOLD REQUIRED)
message("starting")
brlcad_find_package(pugixml)
brlcad_find_package(assimp)
message("done")

set(FACETIZE_LOCAL_INCLUDE_DIRS)

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})
Expand Down
7 changes: 4 additions & 3 deletions src/libged/facetize/subprocess/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions src/librt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ad25479

Please sign in to comment.