Skip to content

Commit

Permalink
OpenCVDetectPython.cmake: set minimum python versions
Browse files Browse the repository at this point in the history
This fixes compilation when python is not found or only one version of python
is found

Signed-off-by: Brendan Le Foll <[email protected]>
  • Loading branch information
arfoll committed Jun 1, 2016
1 parent 8329bca commit 5160d90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/modules/OpenCVDetectPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ if(NOT ${found})
endif()
endfunction(find_python)

set(MIN_VER_PYTHON2 2.7)
set(MIN_VER_PYTHON3 3.2)

find_python(2.7 "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR
PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING
PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND
Expand All @@ -146,7 +149,6 @@ find_python(3 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
PYTHON3_DEBUG_LIBRARIES PYTHON3_LIBRARY_DEBUG PYTHON3_INCLUDE_PATH
PYTHON3_INCLUDE_DIR PYTHON3_INCLUDE_DIR2 PYTHON3_PACKAGES_PATH)


if(PYTHON_DEFAULT_EXECUTABLE)
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
elseif(PYTHON2INTERP_FOUND) # Use Python 2 as default Python interpreter
Expand Down

0 comments on commit 5160d90

Please sign in to comment.