diff options
Diffstat (limited to 'cmake/Modules/GrPython.cmake')
-rw-r--r-- | cmake/Modules/GrPython.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake index 326b2076f5..42d980494b 100644 --- a/cmake/Modules/GrPython.cmake +++ b/cmake/Modules/GrPython.cmake @@ -92,8 +92,12 @@ endmacro(GR_PYTHON_CHECK_MODULE) ######################################################################## if(NOT DEFINED GR_PYTHON_DIR) execute_process(COMMAND ${PYTHON_EXECUTABLE} -c " -import site -print(site.getsitepackages()[0]) +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() |