Commit 5fdb1837 authored by David Gobbi's avatar David Gobbi

Fix cmake check for minimum supported Python version

One of the VTK dashboards had problems evaluating PYTHON_VERSION,
so stick with PYTHON_MAJOR_VERSION and PYTHON_MINOR_VERSION instead.
Also, change SEND_ERROR to FATAL_ERROR.
parent 643e587e
......@@ -7,15 +7,15 @@ include(vtkWrapPython)
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)
if(PYTHON_MINOR_VERSION LESS 2)
message(FATAL_ERROR ${_message})
elseif(NOT VTK_LEGACY_SILENT AND PYTHON_MINOR_VERSION LESS 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)
if(PYTHON_MINOR_VERSION LESS 6)
message(FATAL_ERROR ${_message})
elseif(NOT VTK_LEGACY_SILENT AND PYTHON_MINOR_VERSION LESS 7)
message(WARNING ${_warning})
endif()
endif()
......
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