- The user can now pass its own interpreter. - Development libraries and headers can be requested. - Travis-CI switched to new container-based workers.
37 lines
1.2 KiB
CMake
37 lines
1.2 KiB
CMake
#.rst:
|
|
#
|
|
# Detects Python interpreter.
|
|
#
|
|
# Variables used::
|
|
#
|
|
# PYTHON_INTERPRETER - User-set path to the Python interpreter
|
|
#
|
|
# Variables defined::
|
|
#
|
|
# PYTHONINTERP_FOUND - Was the Python executable found
|
|
# PYTHON_EXECUTABLE - path to the Python interpreter
|
|
# PYTHON_VERSION_STRING - Python version found e.g. 2.5.2
|
|
# PYTHON_VERSION_MAJOR - Python major version found e.g. 2
|
|
# PYTHON_VERSION_MINOR - Python minor version found e.g. 5
|
|
# PYTHON_VERSION_PATCH - Python patch version found e.g. 2
|
|
#
|
|
# autocmake.cfg configuration::
|
|
#
|
|
# docopt: --python=<PYTHON_INTERPRETER> The Python interpreter (development version) to use. [default: ''].
|
|
# define: '-DPYTHON_INTERPRETER="%s"' % arguments['--python']
|
|
|
|
if("${PYTHON_INTERPRETER}" STREQUAL "")
|
|
find_package(PythonInterp REQUIRED)
|
|
else()
|
|
if(NOT EXISTS "${PYTHON_INTERPRETER}")
|
|
find_program(PYTHON_EXECUTABLE NAMES ${PYTHON_INTERPRETER})
|
|
if (NOT EXISTS "${PYTHON_EXECUTABLE}")
|
|
set(PYTHONINTERP_FOUND FALSE)
|
|
endif()
|
|
else()
|
|
set(PYTHONINTERP_FOUND TRUE)
|
|
set(PYTHON_EXECUTABLE "${PYTHON_INTERPRETER}")
|
|
endif()
|
|
endif()
|
|
find_package(PythonInterp REQUIRED)
|