mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
Merge pull request #21219 from asenyaev:asen/remove_distutils
* Replaced distutils module to sysconfig * Fixed getting a path to python lib
This commit is contained in:
parent
16b674b984
commit
d6891c705e
@ -177,7 +177,7 @@ if(NOT ${found})
|
||||
|
||||
if(NOT ANDROID AND NOT IOS)
|
||||
if(CMAKE_HOST_UNIX)
|
||||
execute_process(COMMAND ${_executable} -c "from distutils.sysconfig import *; print(get_python_lib())"
|
||||
execute_process(COMMAND ${_executable} -c "from sysconfig import *; print(get_path('purelib'))"
|
||||
RESULT_VARIABLE _cvpy_process
|
||||
OUTPUT_VARIABLE _std_packages_path
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
@ -63,7 +63,7 @@ else()
|
||||
if("${${PYTHON}_VERSION_MAJOR}" STREQUAL "2")
|
||||
set(__python_ext_suffix_var "SO")
|
||||
endif()
|
||||
execute_process(COMMAND ${${PYTHON}_EXECUTABLE} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('${__python_ext_suffix_var}'))"
|
||||
execute_process(COMMAND ${${PYTHON}_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var('${__python_ext_suffix_var}'))"
|
||||
RESULT_VARIABLE PYTHON_CVPY_PROCESS
|
||||
OUTPUT_VARIABLE CVPY_SUFFIX
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
Loading…
Reference in New Issue
Block a user