Updated cmake files to use print().
In these cases, just using print() is enough to ensure py2/3 compatibility.
This commit is contained in:
parent
fb9781b97b
commit
bce1b352e7
@ -49,7 +49,7 @@ if(PYTHON_EXECUTABLE)
|
|||||||
|
|
||||||
if(NOT ANDROID AND NOT IOS)
|
if(NOT ANDROID AND NOT IOS)
|
||||||
if(CMAKE_HOST_UNIX)
|
if(CMAKE_HOST_UNIX)
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import *; print get_python_lib()"
|
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import *; print(get_python_lib())"
|
||||||
RESULT_VARIABLE PYTHON_CVPY_PROCESS
|
RESULT_VARIABLE PYTHON_CVPY_PROCESS
|
||||||
OUTPUT_VARIABLE PYTHON_STD_PACKAGES_PATH
|
OUTPUT_VARIABLE PYTHON_STD_PACKAGES_PATH
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
@ -80,7 +80,7 @@ if(PYTHON_EXECUTABLE)
|
|||||||
|
|
||||||
if(NOT PYTHON_NUMPY_INCLUDE_DIR)
|
if(NOT PYTHON_NUMPY_INCLUDE_DIR)
|
||||||
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
|
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print numpy.distutils.misc_util.get_numpy_include_dirs()[0]"
|
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print(numpy.distutils.misc_util.get_numpy_include_dirs()[0])"
|
||||||
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
||||||
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR
|
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
@ -92,7 +92,7 @@ if(PYTHON_EXECUTABLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(PYTHON_NUMPY_INCLUDE_DIR)
|
if(PYTHON_NUMPY_INCLUDE_DIR)
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.version.version"
|
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print(numpy.version.version)"
|
||||||
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
|
||||||
OUTPUT_VARIABLE PYTHON_NUMPY_VERSION
|
OUTPUT_VARIABLE PYTHON_NUMPY_VERSION
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
@ -67,7 +67,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})
|
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})
|
||||||
|
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('SO')"
|
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('SO'))"
|
||||||
RESULT_VARIABLE PYTHON_CVPY_PROCESS
|
RESULT_VARIABLE PYTHON_CVPY_PROCESS
|
||||||
OUTPUT_VARIABLE CVPY_SUFFIX
|
OUTPUT_VARIABLE CVPY_SUFFIX
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user