Explorar o código

use get_python_lib again, but adding parenthesis for print. this syntax works with python 2.7 and 3.4

Holger Jeromin %!s(int64=9) %!d(string=hai) anos
pai
achega
0d99e7ee49
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      CMakeLists.txt

+ 1 - 1
CMakeLists.txt

@@ -6,7 +6,7 @@ project(open62541 C)
 FIND_PACKAGE(PythonInterp REQUIRED)
 
 # Find Python-lxml
-execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import site; site.getsitepackages()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
 if(NOT EXISTS "${PYTHON_SITE_PACKAGES}/lxml")
     message( FATAL_ERROR "Python-lxml is not installed.")
 endif()