bullet3/examples/pybullet/CMakeLists.txt

95 lines
2.3 KiB
CMake
Raw Normal View History

2019-06-14 14:49:24 +00:00
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src
${BULLET_PHYSICS_SOURCE_DIR}/examples
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/enet/include
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/clsocket/src
${PYTHON_INCLUDE_DIRS}
)
IF(BUILD_PYBULLET_NUMPY)
2019-06-14 14:49:24 +00:00
INCLUDE_DIRECTORIES(
${PYTHON_NUMPY_INCLUDE_DIR}
)
ENDIF()
ADD_DEFINITIONS(-DSTATIC_LINK_SPD_PLUGIN)
SET(pybullet3_SRCS
pybullet.c
)
2019-06-14 14:49:24 +00:00
SET(pybullet_SRCS
pybullet.c
)
IF(BUILD_CLSOCKET)
2019-06-14 14:49:24 +00:00
ADD_DEFINITIONS(-DBT_ENABLE_CLSOCKET)
ENDIF()
2019-06-14 14:49:24 +00:00
IF(WIN32)
LINK_LIBRARIES(
${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
)
IF(BUILD_ENET)
2019-06-14 14:49:24 +00:00
ADD_DEFINITIONS(-DWIN32 -DBT_ENABLE_ENET)
ENDIF()
IF(BUILD_CLSOCKET)
2019-06-14 14:49:24 +00:00
ADD_DEFINITIONS(-DWIN32)
ENDIF()
2019-06-14 14:49:24 +00:00
ELSE(WIN32)
IF(BUILD_ENET)
2019-06-14 14:49:24 +00:00
ADD_DEFINITIONS(-DHAS_SOCKLEN_T -DBT_ENABLE_ENET)
ENDIF()
2019-06-14 14:49:24 +00:00
IF(BUILD_CLSOCKET)
2019-06-14 14:49:24 +00:00
ADD_DEFINITIONS(${OSDEF})
ENDIF()
2019-06-14 14:49:24 +00:00
ENDIF(WIN32)
ADD_LIBRARY(pybullet SHARED ${pybullet_SRCS})
SET_TARGET_PROPERTIES(pybullet PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(pybullet PROPERTIES POSTFIX "")
SET_TARGET_PROPERTIES(pybullet PROPERTIES VERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(pybullet PROPERTIES SOVERSION ${BULLET_VERSION})
SET_TARGET_PROPERTIES(pybullet PROPERTIES DEBUG_POSTFIX "_d")
2019-06-14 14:49:24 +00:00
IF(WIN32)
IF(BUILD_ENET OR BUILD_CLSOCKET)
2019-06-14 14:49:24 +00:00
TARGET_LINK_LIBRARIES(pybullet ws2_32 )
ENDIF()
2019-06-14 14:49:24 +00:00
SET_TARGET_PROPERTIES(pybullet PROPERTIES SUFFIX ".pyd" )
ENDIF(WIN32)
2019-06-14 14:49:24 +00:00
IF (APPLE)
SET_TARGET_PROPERTIES(pybullet PROPERTIES SUFFIX ".so" )
2019-01-11 19:47:36 +00:00
ENDIF()
2019-06-14 14:49:24 +00:00
TARGET_LINK_LIBRARIES(pybullet BulletRoboticsGUI BulletExampleBrowserLib BulletRobotics BulletFileLoader BulletWorldImporter BulletSoftBody BulletDynamics BulletCollision BulletInverseDynamicsUtils BulletInverseDynamics LinearMath OpenGLWindow gwen BussIK Bullet3Common)
2019-06-14 14:49:24 +00:00
IF (WIN32)
2019-01-12 10:36:28 +00:00
TARGET_LINK_LIBRARIES(pybullet ${PYTHON_LIBRARIES})
2019-06-14 14:49:24 +00:00
ELSEIF (APPLE)
SET_TARGET_PROPERTIES(pybullet PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
ENDIF ()
2019-01-12 10:36:28 +00:00
# else Linux: dont link
2019-01-11 19:46:06 +00:00
IF(WIN32)
SET(PYTHON_SITE_PACKAGES Lib/site-packages CACHE PATH "Python install path")
ELSE()
2019-06-14 14:49:24 +00:00
SET(PYTHON_SITE_PACKAGES lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages CACHE PATH "Python install path")
2019-01-11 19:46:06 +00:00
ENDIF()
INSTALL(TARGETS pybullet DESTINATION ${PYTHON_SITE_PACKAGES})
2019-06-14 14:49:24 +00:00