
If both Python 2 and Python 3 are found, then build bindings for both of them during the build process. Currently, one version of Python is detected automatically, and building for the other requires changes the CMake config. The largest chunk of this change generalizes OpenCVDetectPython.cmake to find both a Python 2 and Python 3 version of Python. Secondly, the opencv_python module is split into two modules, opencv_python2 and opencv_python3. Both are built from the same source. but for different versions of Python.
17 lines
449 B
CMake
17 lines
449 B
CMake
# ----------------------------------------------------------------------------
|
|
# CMake file for python support
|
|
# ----------------------------------------------------------------------------
|
|
|
|
if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
ocv_module_disable(python2)
|
|
ocv_module_disable(python3)
|
|
endif()
|
|
|
|
if(ANDROID OR IOS)
|
|
ocv_module_disable(python2)
|
|
ocv_module_disable(python3)
|
|
endif()
|
|
|
|
add_subdirectory(python2)
|
|
add_subdirectory(python3)
|