diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c2d5fa0a..324fbc8b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -267,7 +267,10 @@ IF(BUILD_PYBULLET) OPTION(BUILD_PYBULLET_NUMPY "Set when you want to build pybullet with NumPy support" OFF) OPTION(BUILD_PYBULLET_ENET "Set when you want to build pybullet with enet UDP networking support" ON) OPTION(BUILD_PYBULLET_CLSOCKET "Set when you want to build pybullet with enet TCP networking support" ON) - + + OPTION(BUILD_PYBULLET_MAC_USE_PYTHON_FRAMEWORK "Set when you want to use the Python Framework on Mac" ON) ++#if defined(__APPLE__) && (!defined(B3_NO_PYTHON_FRAMEWORK)) + IF(BUILD_PYBULLET_NUMPY) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/build3/cmake) #include(FindNumPy) @@ -286,6 +289,19 @@ IF(BUILD_PYBULLET) ELSE(WIN32) SET(BUILD_SHARED_LIBS ON CACHE BOOL "Shared Libs" FORCE) ENDIF(WIN32) + + IF(APPLE) + OPTION(BUILD_PYBULLET_MAC_USE_PYTHON_FRAMEWORK "Set when you want to use the Python Framework on Mac" ON) + IF(NOT BUILD_PYBULLET_MAC_USE_PYTHON_FRAMEWORK) + add_definitions(-DB3_NO_PYTHON_FRAMEWORK) + ENDIF(NOT BUILD_PYBULLET_MAC_USE_PYTHON_FRAMEWORK) + OPTION(BUILD_PYBULLET_SHOW_PY_VERSION "Set when you want to show the PY_MAJOR_VERSION and PY_MAJOR_VERSION using #pragme message." OFF) + IF(BUILD_PYBULLET_SHOW_PY_VERSION) + add_definitions(-DB3_DUMP_PYTHON_VERSION) + ENDIF() + + ENDIF(APPLE) + ENDIF(BUILD_PYBULLET) IF(BUILD_BULLET3) diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index a8d04318b..d3160dcf6 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -11,16 +11,25 @@ #include "../SharedMemory/PhysicsClientTCP_C_API.h" #endif //BT_ENABLE_CLSOCKET -#ifdef __APPLE__ +#if defined(__APPLE__) && (!defined(B3_NO_PYTHON_FRAMEWORK)) #include #else #include #endif +#ifdef B3_DUMP_PYTHON_VERSION +#define B3_VALUE_TO_STRING(x) #x +#define B3_VALUE(x) B3_VALUE_TO_STRING(x) +#define B3_VAR_NAME_VALUE(var) #var "=" B3_VALUE(var) +#pragma message(B3_VAR_NAME_VALUE(PY_MAJOR_VERSION)) +#pragma message(B3_VAR_NAME_VALUE(PY_MINOR_VERSION)) +#endif + #ifdef PYBULLET_USE_NUMPY #include #endif + #if PY_MAJOR_VERSION >= 3 #define PyInt_FromLong PyLong_FromLong #define PyString_FromString PyBytes_FromString diff --git a/setup.py b/setup.py index 69714caa7..2f56ef9ee 100644 --- a/setup.py +++ b/setup.py @@ -391,7 +391,7 @@ elif _platform == "darwin": setup( name = 'pybullet', - version='0.1.6', + version='0.1.7', description='Official Python Interface for the Bullet Physics SDK Robotics Simulator', long_description='pybullet is an easy to use Python module for physics simulation, robotics and machine learning based on the Bullet Physics SDK. With pybullet you can load articulated bodies from URDF, SDF and other file formats. pybullet provides forward dynamics simulation, inverse dynamics computation, forward and inverse kinematics and collision detection and ray intersection queries. Aside from physics simulation, pybullet supports to rendering, with a CPU renderer and OpenGL visualization and support for virtual reality headsets.', url='https://github.com/bulletphysics/bullet3',