only probe for python if PYBULLET explicitly specified

This commit is contained in:
Joey Liaw
2017-10-27 16:32:35 -07:00
parent c208505800
commit 1f564d5c57

View File

@@ -301,25 +301,26 @@ IF (APPLE)
ENDIF() ENDIF()
OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON) OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON)
# Optional Python configuration # Optional Python configuration
# builds pybullet automatically if all the requirements are met # Will not probe environment for Python configuration (which can abort the
SET(PYTHON_VERSION_PYBULLET "" CACHE STRING "Python version pybullet will use.") # build process) unless you explicitly turn on BUILD_PYBULLET.
SET(Python_ADDITIONAL_VERSIONS 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.7.12 2.7.10 2.7.3 ) OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" OFF)
SET_PROPERTY(CACHE PYTHON_VERSION_PYBULLET PROPERTY STRINGS ${Python_ADDITIONAL_VERSIONS}) IF(BUILD_PYBULLET)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build3/cmake ${CMAKE_MODULE_PATH}) SET(PYTHON_VERSION_PYBULLET "" CACHE STRING "Python version pybullet will use.")
OPTION(EXACT_PYTHON_VERSION "Require Python and match PYTHON_VERSION_PYBULLET exactly, e.g. 2.7.12" OFF) SET(Python_ADDITIONAL_VERSIONS 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.7.12 2.7.10 2.7.3 )
IF(EXACT_PYTHON_VERSION) SET_PROPERTY(CACHE PYTHON_VERSION_PYBULLET PROPERTY STRINGS ${Python_ADDITIONAL_VERSIONS})
set(EXACT_PYTHON_VERSION_FLAG EXACT REQUIRED) SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build3/cmake ${CMAKE_MODULE_PATH})
ENDIF(EXACT_PYTHON_VERSION) OPTION(EXACT_PYTHON_VERSION "Require Python and match PYTHON_VERSION_PYBULLET exactly, e.g. 2.7.12" OFF)
# first find the python interpreter IF(EXACT_PYTHON_VERSION)
FIND_PACKAGE(PythonInterp ${PYTHON_VERSION_PYBULLET} ${EXACT_PYTHON_VERSION_FLAG}) set(EXACT_PYTHON_VERSION_FLAG EXACT REQUIRED)
# python library should exactly match that of the interpreter ENDIF(EXACT_PYTHON_VERSION)
FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT) # first find the python interpreter
SET(DEFAULT_BUILD_PYBULLET OFF) FIND_PACKAGE(PythonInterp ${PYTHON_VERSION_PYBULLET} ${EXACT_PYTHON_VERSION_FLAG})
IF(PYTHONLIBS_FOUND) # python library should exactly match that of the interpreter
SET(DEFAULT_BUILD_PYBULLET ON) # the following can result in fatal error if you don't have the right python configuration
ENDIF(PYTHONLIBS_FOUND) FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" ${DEFAULT_BUILD_PYBULLET}) ENDIF(BUILD_PYBULLET)
OPTION(BUILD_ENET "Set when you want to build apps with enet UDP networking support" ON) OPTION(BUILD_ENET "Set when you want to build apps with enet UDP networking support" ON)
OPTION(BUILD_CLSOCKET "Set when you want to build apps with enet TCP networking support" ON) OPTION(BUILD_CLSOCKET "Set when you want to build apps with enet TCP networking support" ON)