Commit 643e587e authored by David Gobbi's avatar David Gobbi

Add cmake check for minimum supported Python version

We will be removing support for Python 2.6 and Python 3.2 in the near
future, so add deprecation warnings for these.  For older versions of
Python, generate an error.  This deprecation is due in part to the
fact that WebPython now requires Python 2.7 or 3.3+.
parent fc5780e3
......@@ -3,6 +3,23 @@
set(VTK_WRAP_PYTHON_FIND_LIBS ON)
include(vtkWrapPython)
# Check minimum versions of Python
set(_message "Python ${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION} is too old, use Python 2.7 or 3.3+")
set(_warning "Python ${PYTHON_MAJOR_VERSION}.${PYTHON_MINOR_VERSION} support is deprecated, use Python 2.7 or 3.3+")
if(PYTHON_MAJOR_VERSION EQUAL 3)
if(PYTHON_VERSION VERSION_LESS 3.2)
message(SEND_ERROR ${_message})
elseif(NOT VTK_LEGACY_SILENT AND PYTHON_VERSION VERSION_LESS 3.3)
message(WARNING ${_warning})
endif()
else()
if(PYTHON_VERSION VERSION_LESS 2.6)
message(SEND_ERROR ${_message})
elseif(NOT VTK_LEGACY_SILENT AND PYTHON_VERSION VERSION_LESS 2.7)
message(WARNING ${_warning})
endif()
endif()
set(${vtk-module}_LIBRARIES ${PYTHON_LIBRARIES})
set(${vtk-module}_SYSTEM_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}")
set(${vtk-module}_NO_Header_Test 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment