From 5bfc027061af9bedc41e83b8c749bb97d93e35be Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 25 May 2021 11:57:03 -0500 Subject: [PATCH] Fix bazel config file generation for 6.10 (#25) * Fix bazel config file generation for 6.10 Signed-off-by: Michael Carroll * Add support for bullet collision detector Signed-off-by: Michael Carroll --- BUILD.bazel | 84 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 61 insertions(+), 23 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 46f052de23cd0..c3034073a9f4e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -4,6 +4,7 @@ load( "IGNITION_ROOT", "IGNITION_VISIBILITY", "generate_include_header", + "cmake_configure_file", ) package( @@ -37,6 +38,31 @@ generated_includes = [ for subdir in generated_includes ] +cmake_configure_file( + name = "config", + src = "dart/config.hpp.in", + out = "dart/config.hpp", + cmakelists = ["dart/CMakeLists.txt"], + defines = [ + "PROJECT_NAME=dart", + "DART_MAJOR_VERSION=6", + "DART_MINOR_VERSION=10", + "DART_PATCH_VERSION=10", + "DART_VERSION=6.10.0", + "DART_PKG_DESC='Dynamic Animation and Robotics Toolkit'", + "BUILD_TYPE_RELEASE=1", + "HAVE_BULLET=1", + "HAVE_NLOPT=1", + "HAVE_ODE=1", + "DART_ENABLE_SIMD=1", + "CMAKE_SOURCE_DIR=dart", + "CMAKE_INSTALL_PREFIX=.", + "DART_ADDITIONAL_DOCUMENTATION_INSTALL_PATH=dart", + "ASSIMP_AISCENE_CTOR_DTOR_DEFINED=1", + "ASSIMP_AIMATERIAL_CTOR_DTOR_DEFINED=1", + ] +) + # collision has two subdirectories with generated includes unlike the above # so treat it as a separate case generate_include_header( @@ -47,6 +73,14 @@ generate_include_header( ]), ) +generate_include_header( + name = "collision_bullet_genrule", + out = "dart/collision/bullet/bullet.hpp", + hdrs = glob([ + "dart/collision/bullet/*.hpp", + ]), +) + generate_include_header( name = "collision_dart_genrule", out = "dart/collision/dart/dart.hpp", @@ -61,6 +95,7 @@ generate_include_header( hdrs = glob([ "dart/collision/*.hpp", ]) + [ + "dart/collision/dart/bullet.hpp", "dart/collision/dart/dart.hpp", "dart/collision/fcl/fcl.hpp", ], @@ -116,13 +151,14 @@ cc_library( "dart/common/detail/*.cpp", "dart/common/*.hpp", "dart/common/detail/*.hpp", - "dart/config.hpp", ]) + [ "dart/common/common.hpp", + "dart/config.hpp", ], hdrs = glob([ "dart/common/*.hpp", "dart/common/detail/*.hpp", + ] + [ "dart/config.hpp", ]), includes = ["."], @@ -175,16 +211,11 @@ cc_library( srcs = glob([ "dart/collision/*.cpp", "dart/collision/detail/*.cpp", - "dart/collision/*.hpp", - "dart/collision/detail/*.hpp", - ]) + [ - "dart/collision/collision.hpp", - "dart/collision/fcl/fcl.hpp", - "dart/collision/dart/dart.hpp", - ], + ]), hdrs = glob([ "dart/collision/*.hpp", "dart/collision/detail/*.hpp", + "dart/collision/collision.hpp", ]), deps = [ ":dart-dynamics", @@ -197,12 +228,11 @@ cc_library( srcs = glob([ "dart/collision/ode/*.cpp", "dart/collision/ode/detail/*.cpp", - "dart/collision/ode/*.hpp", - "dart/collision/ode/detail/*.hpp", ]), hdrs = glob([ "dart/collision/ode/*.hpp", "dart/collision/ode/detail/*.hpp", + "dart/collision/ode/ode.hpp", ]), deps = [ ":dart-collision-core", @@ -213,14 +243,33 @@ cc_library( ], ) +cc_library( + name = "dart-collision-bullet", + srcs = glob([ + "dart/collision/bullet/*.cpp", + "dart/collision/bullet/detail/*.cpp", + ]), + hdrs = glob([ + "dart/collision/bullet/*.hpp", + "dart/collision/bullet/detail/*.hpp", + "dart/collision/bullet/bullet.hpp", + ]), + deps = [ + ":dart-collision-core", + ":dart-dynamics", + ":dart-math", + "@bullet", + ], +) + cc_library( name = "dart-collision-fcl", srcs = glob([ "dart/collision/fcl/*.cpp", - "dart/collision/fcl/*.hpp", ]), hdrs = glob([ "dart/collision/fcl/*.hpp", + "dart/collision/fcl/fcl.hpp", ]), deps = [ ":dart-collision-core", @@ -249,6 +298,7 @@ cc_library( cc_library( name = "dart-collision", deps = [ + ":dart-collision-bullet", ":dart-collision-core", ":dart-collision-dart", ":dart-collision-fcl", @@ -436,17 +486,5 @@ cc_binary( includes = ["dart"], deps = [ ":dart", - ":dart-collision", - ":dart-common", - ":dart-constraint", - ":dart-dynamics", - ":dart-external", - ":dart-gui", - ":dart-integration", - ":dart-lcpsolver", - ":dart-math", - ":dart-optimizer", - ":dart-simulation", - ":dart-utils", ], )