Explorar o código

Check if a plattform specific lxml package exists in addition to the general lib (fails otherwise for x86_64 OpenSuse 13.2, possibly others, even if lxml is installed).

ichrispa %!s(int64=9) %!d(string=hai) anos
pai
achega
60f3d401ad
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      CMakeLists.txt

+ 4 - 1
CMakeLists.txt

@@ -8,7 +8,10 @@ FIND_PACKAGE(PythonInterp REQUIRED)
 # Find Python-lxml
 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.")
+    execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" 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()
 endif()
 
 find_package(Git)