Skip to content

Commit

Permalink
Fix support for assimp 5.1.0 (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ace314159 authored Feb 22, 2022
1 parent 9816bea commit 1211b17
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
25 changes: 15 additions & 10 deletions rviz_assimp_vendor/rviz_assimp_vendor-extras.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ find_package(assimp REQUIRED QUIET)
string(REPLACE "/lib/lib/" "/lib/" ASSIMP_LIBRARY_DIRS "${ASSIMP_LIBRARY_DIRS}")
string(REGEX REPLACE "/lib/include$" "/include" ASSIMP_INCLUDE_DIRS "${ASSIMP_INCLUDE_DIRS}")

set(rviz_assimp_vendor_LIBRARIES)
foreach(library IN LISTS ASSIMP_LIBRARIES)
message(STATUS "library: ${library}")
if(IS_ABSOLUTE "${library}")
list(APPEND rviz_assimp_vendor_LIBRARIES "${library}")
else()
find_library(library_abs ${library} PATHS "${ASSIMP_LIBRARY_DIRS}" NO_DEFAULT_PATH)
list(APPEND rviz_assimp_vendor_LIBRARIES "${library_abs}")
endif()
endforeach()
# Fix for https://github.com/ros2/ros2/issues/1222
if(TARGET assimp::assimp AND "${assimp_VERSION}" VERSION_GREATER 5.0.1)
set(rviz_assimp_vendor_LIBRARIES assimp::assimp)
else()
set(rviz_assimp_vendor_LIBRARIES)
foreach(library IN LISTS ASSIMP_LIBRARIES)
message(STATUS "library: ${library}")
if(IS_ABSOLUTE "${library}")
list(APPEND rviz_assimp_vendor_LIBRARIES "${library}")
else()
find_library(library_abs ${library} PATHS "${ASSIMP_LIBRARY_DIRS}" NO_DEFAULT_PATH)
list(APPEND rviz_assimp_vendor_LIBRARIES "${library_abs}")
endif()
endforeach()
endif()
set(rviz_assimp_vendor_LIBRARY_DIRS ${ASSIMP_LIBRARY_DIRS})
set(rviz_assimp_vendor_INCLUDE_DIRS ${ASSIMP_INCLUDE_DIRS})
1 change: 1 addition & 0 deletions rviz_rendering/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ ament_target_dependencies(rviz_rendering
)
ament_export_dependencies(
rviz_ogre_vendor
rviz_assimp_vendor
eigen3_cmake_module
Eigen3
resource_retriever
Expand Down

0 comments on commit 1211b17

Please sign in to comment.