Skip to content

Commit

Permalink
Merge pull request #8 from traversaro/fix-bullet
Browse files Browse the repository at this point in the history
Depend on bullet-cpp and check that bullet collision detector is built and fix linking of fcl and assimp on Windows
  • Loading branch information
traversaro authored Mar 26, 2021
2 parents e2c9b27 + 23564e4 commit c461e7c
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 2 deletions.
66 changes: 66 additions & 0 deletions recipe/1510.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
From 2ed57ec92624080e1661441e1572b867378d0f5f Mon Sep 17 00:00:00 2001
From: Silvio Traversaro <[email protected]>
Date: Sat, 17 Oct 2020 02:20:05 +0200
Subject: [PATCH] Fix MSVC linking for assimp and fcl (#1510)

Co-authored-by: Jeongseok Lee <[email protected]>
---
cmake/Findassimp.cmake | 9 +++++++--
cmake/Findfcl.cmake | 9 +++++++--
2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/cmake/Findassimp.cmake b/cmake/Findassimp.cmake
index 3063d6d20cb..07b4a417385 100644
--- a/cmake/Findassimp.cmake
+++ b/cmake/Findassimp.cmake
@@ -26,7 +26,10 @@ find_path(ASSIMP_INCLUDE_DIRS assimp/scene.h

# Libraries
if(MSVC)
- set(ASSIMP_LIBRARIES "assimp$<$<CONFIG:Debug>:d>")
+ find_package(assimp QUIET CONFIG)
+ if(TARGET assimp::assimp)
+ set(ASSIMP_LIBRARIES "assimp::assimp")
+ endif()
else()
find_library(ASSIMP_LIBRARIES
NAMES assimp
@@ -34,7 +37,9 @@ else()
endif()

# Version
-set(ASSIMP_VERSION ${PC_ASSIMP_VERSION})
+if(PC_ASSIMP_VERSION)
+ set(ASSIMP_VERSION ${PC_ASSIMP_VERSION})
+endif()

# Set (NAME)_FOUND if all the variables and the version are satisfied.
include(FindPackageHandleStandardArgs)
diff --git a/cmake/Findfcl.cmake b/cmake/Findfcl.cmake
index e49de2cadb2..5f586c675dc 100644
--- a/cmake/Findfcl.cmake
+++ b/cmake/Findfcl.cmake
@@ -28,7 +28,10 @@ find_path(FCL_INCLUDE_DIRS

# Libraries
if(MSVC)
- set(FCL_LIBRARIES "fcl$<$<CONFIG:Debug>:d>")
+ find_package(fcl QUIET CONFIG)
+ if(TARGET fcl)
+ set(FCL_LIBRARIES fcl)
+ endif()
else()
# Give explicit precedence to ${PC_FCL_LIBDIR}
find_library(FCL_LIBRARIES
@@ -44,7 +47,9 @@ else()
endif()

# Version
-set(FCL_VERSION ${PC_FCL_VERSION})
+if(PC_FCL_VERSION)
+ set(FCL_VERSION ${PC_FCL_VERSION})
+endif()

# Set (NAME)_FOUND if all the variables and the version are satisfied.
include(FindPackageHandleStandardArgs)

7 changes: 5 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ source:
patches:
- 1478.patch # [win]
- 1541.patch # [win]
- 1510.patch
- ode-required.patch

build:
number: 3
number: 4
run_exports:
- {{ pin_subpackage(name, max_pin='x.x') }}

Expand Down Expand Up @@ -46,7 +47,7 @@ requirements:
run:
- assimp
- boost-cpp
- bullet
- bullet-cpp
- console_bridge
- eigen
- fcl
Expand All @@ -64,8 +65,10 @@ test:
- test -f $PREFIX/lib/libdart.dylib # [osx]
- test -f $PREFIX/lib/libdart.so # [linux]
- test -f $PREFIX/share/dart/cmake/dart_collision-odeTargets.cmake # [not win]
- test -f $PREFIX/share/dart/cmake/dart_collision-bulletTargets.cmake # [not win]
- if not exist %LIBRARY_LIB%\\dart.lib exit 1 # [win]
- if not exist %PREFIX%\\Library\\share\\dart\\cmake\\dart_collision-odeTargets.cmake exit 1 # [win]
- if not exist %PREFIX%\\Library\\share\\dart\\cmake\\dart_collision-bulletTargets.cmake exit 1 # [win]

about:
home: http://dartsim.github.io/
Expand Down

0 comments on commit c461e7c

Please sign in to comment.