diff --git a/CMakeLists.txt b/CMakeLists.txt index ec647fd2..1b7a36a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -943,14 +943,18 @@ if (NOT EVENT__DISABLE_TESTS) # if (NOT EVENT__DISABLE_REGRESS) - # (We require python to generate the regress tests) - find_program(FIND_PYTHON2 python2) - if (FIND_PYTHON2) - set(PYTHON_EXECUTABLE "python2") - endif() + # (We require python2 to generate the regress tests) + foreach (PY python2.6 python2.7 python2) + unset(FIND_PYTHON2 CACHE) + find_program(FIND_PYTHON2 ${PY}) + if (FIND_PYTHON2) + set(PYTHON_EXECUTABLE "${PY}") + break() + endif() + endforeach() find_package(PythonInterp) - if (PYTHONINTERP_FOUND) + if (PYTHONINTERP_FOUND AND PYTHON_VERSION_STRING VERSION_LESS "3.0.0") set(__FOUND_USABLE_PYTHON 1) endif()