2016-07-07 00:53:32 +08:00
|
|
|
if(NOT PYTHON3_INCLUDE_PATH OR NOT PYTHON3_NUMPY_INCLUDE_DIRS)
|
2014-06-30 04:45:24 +08:00
|
|
|
ocv_module_disable(python3)
|
|
|
|
endif()
|
|
|
|
|
2019-03-21 15:45:02 +08:00
|
|
|
# Problem in numpy >=1.15 <1.17
|
|
|
|
if(PYTHON3_LIMITED_API
|
|
|
|
AND NOT PYTHON3_NUMPY_VERSION VERSION_LESS "1.15"
|
|
|
|
AND PYTHON3_NUMPY_VERSION VERSION_LESS "1.17"
|
|
|
|
)
|
2020-09-25 19:16:46 +08:00
|
|
|
message(WARNING "Current NUMPY version (${PYTHON3_NUMPY_VERSION}) is not compatible with LIMITED_API.")
|
2019-03-21 15:45:02 +08:00
|
|
|
set(PYTHON3_LIMITED_API OFF)
|
|
|
|
endif()
|
|
|
|
|
2014-06-30 04:45:24 +08:00
|
|
|
set(the_description "The python3 bindings")
|
2014-07-31 13:11:30 +08:00
|
|
|
set(MODULE_NAME python3)
|
2014-08-07 12:21:42 +08:00
|
|
|
set(MODULE_INSTALL_SUBDIR python3)
|
2014-06-30 04:45:24 +08:00
|
|
|
|
2021-09-18 15:02:55 +08:00
|
|
|
set(_ocv_extra_modules_path ${CMAKE_CURRENT_LIST_DIR}/../package/extra_modules)
|
|
|
|
set(_old_ocv_python_extra_modules_path ${OCV_PYTHON_EXTRA_MODULES_PATH})
|
|
|
|
|
|
|
|
if("${OCV_PYTHON_EXTRA_MODULES_PATH}" STREQUAL "")
|
|
|
|
set(OCV_PYTHON_EXTRA_MODULES_PATH ${_ocv_extra_modules_path})
|
|
|
|
else()
|
|
|
|
list(APPEND OCV_PYTHON_EXTRA_MODULES_PATH ${_ocv_extra_modules_path})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
unset(_ocv_extra_modules_path)
|
|
|
|
|
2016-07-07 00:53:32 +08:00
|
|
|
set(PYTHON PYTHON3)
|
2014-06-30 04:45:24 +08:00
|
|
|
|
|
|
|
include(../common.cmake)
|
|
|
|
|
2021-09-18 15:02:55 +08:00
|
|
|
set(OCV_PYTHON_EXTRA_MODULES_PATH ${_old_ocv_python_extra_modules_path})
|
|
|
|
|
|
|
|
unset(_old_ocv_python_extra_modules_path)
|
2014-07-31 13:11:30 +08:00
|
|
|
unset(MODULE_NAME)
|
2014-08-07 12:21:42 +08:00
|
|
|
unset(MODULE_INSTALL_SUBDIR)
|