From fde6cffecc8fcead423a3ebdc101457289531bf2 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Mon, 16 Mar 2020 23:15:18 -0700 Subject: create BulletRoboticsGUI CMake target, pybullet links against it fix BulletRobotics header install --- Extras/BulletRobotics/CMakeLists.txt | 36 +--- Extras/BulletRoboticsGUI/CMakeLists.txt | 208 +++++++++++++++++++++ .../BulletRoboticsGUI/bullet_robotics_gui.pc.cmake | 6 + Extras/CMakeLists.txt | 2 +- 4 files changed, 220 insertions(+), 32 deletions(-) create mode 100644 Extras/BulletRoboticsGUI/CMakeLists.txt create mode 100644 Extras/BulletRoboticsGUI/bullet_robotics_gui.pc.cmake (limited to 'Extras') diff --git a/Extras/BulletRobotics/CMakeLists.txt b/Extras/BulletRobotics/CMakeLists.txt index 38e96775d..2442f6efc 100644 --- a/Extras/BulletRobotics/CMakeLists.txt +++ b/Extras/BulletRobotics/CMakeLists.txt @@ -222,13 +222,6 @@ IF(BUILD_ENET) ENDIF(BUILD_ENET) IF(BUILD_CLSOCKET) - set(BulletRobotics_CLSOCKET_INCLUDES - ../../examples/SharedMemory/PhysicsClientTCP.h - ../../examples/SharedMemory/PhysicsClientTCP_C_API.h - ../../examples/ThirdPartyLibs/clsocket/src/SimpleSocket.h - ../../examples/ThirdPartyLibs/clsocket/src/ActiveSocket.h - ../../examples/ThirdPartyLibs/clsocket/src/PassiveSocket.h - ) set(BulletRobotics_CLSOCKET_SRCS ../../examples/SharedMemory/PhysicsClientTCP.cpp ../../examples/SharedMemory/PhysicsClientTCP_C_API.cpp @@ -237,13 +230,8 @@ IF(BUILD_CLSOCKET) ../../examples/ThirdPartyLibs/clsocket/src/PassiveSocket.cpp ) - set(BulletRobotics_INCLUDES - ${BulletRobotics_INCLUDES} - ${BulletRobotics_CLSOCKET_INCLUDES} - ) set(BulletRobotics_SRCS ${BulletRobotics_SRCS} - ${BulletRobotics_CLSOCKET_INCLUDES} ${BulletRobotics_CLSOCKET_SRCS} ) ENDIF() @@ -260,25 +248,12 @@ IF (BUILD_SHARED_LIBS) TARGET_LINK_LIBRARIES(BulletRobotics BulletInverseDynamicsUtils BulletWorldImporter BulletFileLoader BulletSoftBody BulletDynamics BulletCollision BulletInverseDynamics LinearMath Bullet3Common) ENDIF (BUILD_SHARED_LIBS) -IF (INSTALL_EXTRA_LIBS) - INSTALL(FILES - ../../examples/SharedMemory/PhysicsClientC_API.h - ../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.h - ../../examples/SharedMemory/PhysicsClientSharedMemory2_C_API.h - ../../examples/SharedMemory/PhysicsDirectC_API.h - ../../examples/SharedMemory/PhysicsClientUDP_C_API.h - ../../examples/SharedMemory/PhysicsClientTCP_C_API.h - ../../examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.h - ../../examples/SharedMemory/SharedMemoryPublic.h - ../../examples/SharedMemory/b3RobotSimulatorClientAPI_NoGUI.h - ../../examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h - DESTINATION include/bullet - ) - INSTALL(FILES - ${BulletRobotics_INCLUDES} - DESTINATION include/bullet_robotics - ) + +INSTALL ( + DIRECTORY ${CMAKE_SOURCE_DIR}/examples/ + DESTINATION include/bullet + FILES_MATCHING PATTERN "*.h*") INSTALL(TARGETS BulletRobotics @@ -301,5 +276,4 @@ IF(NOT MSVC) ${PKGCONFIG_INSTALL_PREFIX} ) ENDIF(NOT MSVC) -ENDIF (INSTALL_EXTRA_LIBS) diff --git a/Extras/BulletRoboticsGUI/CMakeLists.txt b/Extras/BulletRoboticsGUI/CMakeLists.txt new file mode 100644 index 000000000..01c61eeda --- /dev/null +++ b/Extras/BulletRoboticsGUI/CMakeLists.txt @@ -0,0 +1,208 @@ + +INCLUDE_DIRECTORIES( + ${BULLET_PHYSICS_SOURCE_DIR}/src + ${BULLET_PHYSICS_SOURCE_DIR}/examples + ${BULLET_PHYSICS_SOURCE_DIR}/examples/SharedMemory + ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs + ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/enet/include + ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/clsocket/src +) + +SET(BulletRoboticsGUI_INCLUDES + ../../examples/CommonInterfaces/Common2dCanvasInterface.h + ../../examples/CommonInterfaces/CommonCallbacks.h + ../../examples/CommonInterfaces/CommonCameraInterface.h + ../../examples/CommonInterfaces/CommonExampleInterface.h + ../../examples/CommonInterfaces/CommonFileIOInterface.h + ../../examples/CommonInterfaces/CommonGraphicsAppInterface.h + ../../examples/CommonInterfaces/CommonGUIHelperInterface.h + ../../examples/CommonInterfaces/CommonMultiBodyBase.h + ../../examples/CommonInterfaces/CommonParameterInterface.h + ../../examples/CommonInterfaces/CommonRenderInterface.h + ../../examples/CommonInterfaces/CommonRigidBodyBase.h + ../../examples/CommonInterfaces/CommonWindowInterface.h + + ../../examples/OpenGLWindow/SimpleCamera.h + + ../../examples/TinyRenderer/geometry.h + ../../examples/TinyRenderer/model.h + ../../examples/TinyRenderer/tgaimage.h + ../../examples/TinyRenderer/our_gl.h + ../../examples/TinyRenderer/TinyRenderer.h + + ../../examples/SharedMemory/plugins/collisionFilterPlugin/collisionFilterPlugin.h + ../../examples/SharedMemory/plugins/pdControlPlugin/pdControlPlugin.h + ../../examples/SharedMemory/b3RobotSimulatorClientAPI_NoGUI.h + ../../examples/SharedMemory/b3RobotSimulatorClientAPI_NoDirect.h + ../../examples/SharedMemory/IKTrajectoryHelper.h + ../../examples/SharedMemory/plugins/tinyRendererPlugin/tinyRendererPlugin.h + ../../examples/SharedMemory/plugins/tinyRendererPlugin/TinyRendererVisualShapeConverter.h + ../../examples/SharedMemory/InProcessMemory.h + ../../examples/SharedMemory/PhysicsServer.h + ../../examples/SharedMemory/PhysicsClient.h + ../../examples/SharedMemory/PhysicsServerSharedMemory.h + ../../examples/SharedMemory/PhysicsDirect.h + ../../examples/SharedMemory/PhysicsDirectC_API.h + ../../examples/SharedMemory/PhysicsServerCommandProcessor.h + ../../examples/SharedMemory/b3PluginManager.h + ../../examples/SharedMemory/PhysicsClientSharedMemory.h + ../../examples/SharedMemory/PhysicsClientSharedMemory_C_API.h + ../../examples/SharedMemory/PhysicsClientC_API.h + ../../examples/SharedMemory/SharedMemoryPublic.h + ../../examples/SharedMemory/Win32SharedMemory.h + ../../examples/SharedMemory/PosixSharedMemory.h + + ../../examples/Utils/b3ResourcePath.h + ../../examples/Utils/RobotLoggingUtil.h + ../../examples/Utils/b3Clock.h + ../../examples/Utils/b3ResourcePath.h + ../../examples/Utils/ChromeTraceUtil.h + ../../examples/Utils/b3ERPCFMHelper.hpp + ../../examples/Utils/b3ReferenceFrameHelper.hpp + + ../../examples/ThirdPartyLibs/tinyxml2/tinyxml2.h + ../../examples/ThirdPartyLibs/Wavefront/tiny_obj_loader.h + ../../examples/ThirdPartyLibs/stb_image/stb_image.h + ../../examples/ThirdPartyLibs/BussIK/Jacobian.h + ../../examples/ThirdPartyLibs/BussIK/LinearR2.h + ../../examples/ThirdPartyLibs/BussIK/LinearR3.h + ../../examples/ThirdPartyLibs/BussIK/LinearR4.h + ../../examples/ThirdPartyLibs/BussIK/MatrixRmn.h + ../../examples/ThirdPartyLibs/BussIK/Node.h + ../../examples/ThirdPartyLibs/BussIK/Tree.h + ../../examples/ThirdPartyLibs/BussIK/VectorRn.h + + ../../examples/Importers/ImportColladaDemo/LoadMeshFromCollada.h + ../../examples/Importers/ImportObjDemo/LoadMeshFromObj.h + ../../examples/Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.h + ../../examples/Importers/ImportMJCFDemo/BulletMJCFImporter.h + ../../examples/Importers/ImportURDFDemo/BulletUrdfImporter.h + ../../examples/Importers/ImportURDFDemo/MyMultiBodyCreator.h + ../../examples/Importers/ImportURDFDemo/URDF2Bullet.h + ../../examples/Importers/ImportURDFDemo/UrdfParser.h + ../../examples/Importers/ImportURDFDemo/urdfStringSplit.h + ../../examples/Importers/ImportURDFDemo/URDFImporterInterface.h + ../../examples/Importers/ImportURDFDemo/URDFJointTypes.h + ../../examples/Importers/ImportURDFDemo/SDFAudioTypes.h + ../../examples/Importers/ImportURDFDemo/UrdfRenderingInterface.h + ../../examples/Importers/ImportURDFDemo/MultiBodyCreationInterface.h + ../../examples/Importers/ImportMeshUtility/b3ImportMeshUtility.h + + ../../examples/MultiThreading/b3PosixThreadSupport.h + ../../examples/MultiThreading/b3Win32ThreadSupport.h + ../../examples/MultiThreading/b3ThreadSupportInterface.h +) + +SET(BulletRoboticsGUI_SRCS ${BulletRoboticsGUI_INCLUDES} + + ../../examples/SharedMemory/plugins/stablePDPlugin/SpAlg.cpp + ../../examples/SharedMemory/plugins/stablePDPlugin/SpAlg.h + ../../examples/SharedMemory/plugins/stablePDPlugin/Shape.cpp + ../../examples/SharedMemory/plugins/stablePDPlugin/Shape.h + ../../examples/SharedMemory/plugins/stablePDPlugin/RBDUtil.cpp + ../../examples/SharedMemory/plugins/stablePDPlugin/RBDUtil.h + ../../examples/SharedMemory/plugins/stablePDPlugin/RBDModel.cpp + ../../examples/SharedMemory/plugins/stablePDPlugin/RBDModel.h + ../../examples/SharedMemory/plugins/stablePDPlugin/MathUtil.cpp + ../../examples/SharedMemory/plugins/stablePDPlugin/MathUtil.h + ../../examples/SharedMemory/plugins/stablePDPlugin/KinTree.cpp + ../../examples/SharedMemory/plugins/stablePDPlugin/KinTree.h + ../../examples/SharedMemory/plugins/stablePDPlugin/BulletConversion.cpp + ../../examples/SharedMemory/plugins/stablePDPlugin/BulletConversion.h + ../../examples/ExampleBrowser/InProcessExampleBrowser.cpp + ../../examples/SharedMemory/GraphicsServerExample.cpp + ../../examples/SharedMemory/GraphicsClientExample.cpp + ../../examples/SharedMemory/RemoteGUIHelper.cpp + ../../examples/SharedMemory/GraphicsServerExample.h + ../../examples/SharedMemory/GraphicsClientExample.h + ../../examples/SharedMemory/RemoteGUIHelper.h + ../../examples/SharedMemory/GraphicsSharedMemoryCommands.h + ../../examples/SharedMemory/GraphicsSharedMemoryPublic.h + ../../examples/SharedMemory/PhysicsServerExample.cpp + ../../examples/SharedMemory/PhysicsServerExampleBullet2.cpp + ../../examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp +) + +IF(BUILD_CLSOCKET) + ADD_DEFINITIONS(-DBT_ENABLE_CLSOCKET) +ENDIF(BUILD_CLSOCKET) + +IF(WIN32) + IF(BUILD_ENET) + ADD_DEFINITIONS(-DWIN32 -DBT_ENABLE_ENET) + ENDIF(BUILD_ENET) + IF(BUILD_CLSOCKET) + ADD_DEFINITIONS(-DWIN32) + ENDIF(BUILD_CLSOCKET) + +ELSE(WIN32) + IF(BUILD_ENET) + ADD_DEFINITIONS(-DHAS_SOCKLEN_T -DBT_ENABLE_ENET) + ENDIF(BUILD_ENET) + + IF(BUILD_CLSOCKET) + ADD_DEFINITIONS(${OSDEF}) + ENDIF(BUILD_CLSOCKET) + + IF(NOT APPLE) + LINK_LIBRARIES( pthread ${DL} ) + ENDIF(NOT APPLE) +ENDIF(WIN32) + +IF(BUILD_ENET) + set(BulletRoboticsGUI_ENET_INCLUDES + ../../examples/SharedMemory/PhysicsClientUDP.h + ../../examples/SharedMemory/PhysicsClientUDP_C_API.h + ../../examples/ThirdPartyLibs/enet/include/enet/win32.h + ../../examples/ThirdPartyLibs/enet/include/enet/unix.h + ../../examples/ThirdPartyLibs/enet/include/enet/callbacks.h + ../../examples/ThirdPartyLibs/enet/include/enet/list.h + ../../examples/ThirdPartyLibs/enet/include/enet/protocol.h + ) + + set(BulletRoboticsGUI_INCLUDES + ${BulletRoboticsGUI_INCLUDES} + ${BulletRoboticsGUI_ENET_INCLUDES} + ) + + + +ENDIF(BUILD_ENET) + + +ADD_DEFINITIONS(-DPHYSICS_SERVER_DIRECT) + + +ADD_LIBRARY(BulletRoboticsGUI ${BulletRoboticsGUI_SRCS}) + +SET_TARGET_PROPERTIES(BulletRoboticsGUI PROPERTIES VERSION ${BULLET_VERSION}) +SET_TARGET_PROPERTIES(BulletRoboticsGUI PROPERTIES SOVERSION ${BULLET_VERSION}) + +IF (BUILD_SHARED_LIBS) + TARGET_LINK_LIBRARIES(BulletRoboticsGUI BulletRobotics BulletInverseDynamicsUtils BulletWorldImporter BulletFileLoader BulletSoftBody BulletDynamics BulletCollision BulletInverseDynamics LinearMath Bullet3Common) +ENDIF (BUILD_SHARED_LIBS) + + + + INSTALL(TARGETS + BulletRoboticsGUI + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) + + IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) + SET_TARGET_PROPERTIES(BulletRobotics PROPERTIES FRAMEWORK true) + SET_TARGET_PROPERTIES(BulletRobotics PROPERTIES PUBLIC_HEADER "PhysicsClientC_API.h" ) + ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) + +IF(NOT MSVC) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bullet_robotics_gui.pc.cmake + ${CMAKE_CURRENT_BINARY_DIR}/bullet_robotics_gui.pc @ONLY) + INSTALL( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/bullet_robotics_gui.pc + DESTINATION + ${PKGCONFIG_INSTALL_PREFIX} + ) +ENDIF(NOT MSVC) + diff --git a/Extras/BulletRoboticsGUI/bullet_robotics_gui.pc.cmake b/Extras/BulletRoboticsGUI/bullet_robotics_gui.pc.cmake new file mode 100644 index 000000000..5eeadefc6 --- /dev/null +++ b/Extras/BulletRoboticsGUI/bullet_robotics_gui.pc.cmake @@ -0,0 +1,6 @@ +Name: bullet_robotics_gui +Description: Bullet GUI extras for robotics +Requires: bullet +Version: @BULLET_VERSION@ +Libs: -L@CMAKE_INSTALL_PREFIX@/@LIB_DESTINATION@ -lBulletRoboticsGUI +Cflags: @BULLET_DOUBLE_DEF@ -I@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@ -I@CMAKE_INSTALL_PREFIX@/include/bullet_robotics_gui diff --git a/Extras/CMakeLists.txt b/Extras/CMakeLists.txt index 6b35357a3..fc0d22604 100644 --- a/Extras/CMakeLists.txt +++ b/Extras/CMakeLists.txt @@ -1,4 +1,4 @@ -SUBDIRS( InverseDynamics BulletRobotics obj2sdf Serialize ConvexDecomposition HACD GIMPACTUtils ) +SUBDIRS( InverseDynamics BulletRoboticsGUI BulletRobotics obj2sdf Serialize ConvexDecomposition HACD GIMPACTUtils ) -- cgit v1.2.1