diff options
author | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2021-09-02 13:44:17 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-11-26 15:03:09 +0000 |
commit | b5663f5d1258eaa29421e8f35311e2352825b238 (patch) | |
tree | 374bb82d44e47548b03c18669defb6c0eb7ebaf9 /sources/shiboken6/cmake/ShibokenHelpers.cmake | |
parent | ef68b737067258221eb2de6b857112da7a994cca (diff) |
Move from distutils to setuptools
This is motivated by the deprecation of distutils,
and removal in future versions
https://github.com/pypa/packaging-problems/issues/127
Change-Id: I16448b69f98df6dc1d9a904b69eb69ed5f1093f5
Reviewed-by: Christian Tismer <tismer@stackless.com>
(cherry picked from commit 95a5bb9dd3b5d3fa86f2ed0868e2b821256a6028)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'sources/shiboken6/cmake/ShibokenHelpers.cmake')
-rw-r--r-- | sources/shiboken6/cmake/ShibokenHelpers.cmake | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sources/shiboken6/cmake/ShibokenHelpers.cmake b/sources/shiboken6/cmake/ShibokenHelpers.cmake index c17401ccc..87a676219 100644 --- a/sources/shiboken6/cmake/ShibokenHelpers.cmake +++ b/sources/shiboken6/cmake/ShibokenHelpers.cmake @@ -78,9 +78,19 @@ endmacro() macro(set_python_site_packages) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "if True: - from distutils import sysconfig + import sysconfig from os.path import sep - print(sysconfig.get_python_lib(1, 0, prefix='${CMAKE_INSTALL_PREFIX}').replace(sep, '/')) + + # /home/qt/dev/env/lib/python3.9/site-packages + lib_path = sysconfig.get_path('purelib') + + # /home/qt/dev/env + data_path = sysconfig.get_path('data') + + # /lib/python3.9/site-packages + rel_path = lib_path.replace(data_path, '') + + print(f'${CMAKE_INSTALL_PREFIX}{rel_path}'.replace(sep, '/')) " OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE) |