diff options
author | Marcus Müller <marcus.mueller@ettus.com> | 2018-11-01 16:44:10 +0100 |
---|---|---|
committer | Marcus Müller <marcus.mueller@ettus.com> | 2018-11-01 16:44:10 +0100 |
commit | 9f5e65d8ae9608acf7526095787d37c95f8fd543 (patch) | |
tree | 081258969a36fe837c1dd1cd2d422ebce4c66fbd /cmake | |
parent | 0d6aa71a114a2d2c6be95bc59c45a621bf053c82 (diff) |
Revert "cmake: fix finding Python packages' installation directory"
This reverts commit 0d6aa71a114a2d2c6be95bc59c45a621bf053c82.
That commit broke the ability to use CMAKE_INSTALL_PREFIX.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/GrPython.cmake | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake index d48915bebe..49a351d3a7 100644 --- a/cmake/Modules/GrPython.cmake +++ b/cmake/Modules/GrPython.cmake @@ -93,12 +93,12 @@ endmacro(GR_PYTHON_CHECK_MODULE) ######################################################################## if(NOT DEFINED GR_PYTHON_DIR) execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " -try: - from site import getsitepackages - print(getsitepackages()[0]) -except ImportError: - from distutils.sysconfig import get_python_lib - print(get_python_lib()) +import os +import sys +if os.name == 'posix': + print(os.path.join('lib', 'python' + sys.version[:3], 'dist-packages')) +if os.name == 'nt': + print(os.path.join('Lib', 'site-packages')) " OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE ) endif() |