Skip to content

Commit

Permalink
cmake: fix finding python2, and check that it is really 2
Browse files Browse the repository at this point in the history
python version check removed in a4d044c
("cmake: use PYTHON_EXECUTABLE to find python2"), but in
bcb990a ("cmake/win32: fix running
regress, but fixing finding python2 interpreter") we set
PYTHON_EXECUTABLE only if it exists.
  • Loading branch information
azat committed Oct 30, 2016
1 parent 8fb08ae commit 3453c08
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 3453c08

Please sign in to comment.