[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdelibs/KDE/4.10] cmake/modules: Do not hardcode site-packages for the python libdir.
From:       Michael Jansen <kde () michael-jansen ! biz>
Date:       2013-01-24 14:48:16
Message-ID: 20130124144816.19FA4A6091 () git ! kde ! org
[Download RAW message or body]

Git commit feabe372895048b41679ceabf34e189ef8edd69b by Michael Jansen.
Committed on 21/01/2013 at 11:44.
Pushed by mjansen into branch 'KDE/4.10'.

Do not hardcode site-packages for the python libdir.

Fixes installation on debian where the directory is named dist-packages.

REVIEW: 108516

M  +7    -2    cmake/modules/FindPythonLibrary.cmake

http://commits.kde.org/kdelibs/feabe372895048b41679ceabf34e189ef8edd69b

diff --git a/cmake/modules/FindPythonLibrary.cmake b/cmake/modules/FindPythonLibrary.cmake
index 7cef79b..78309b7 100644
--- a/cmake/modules/FindPythonLibrary.cmake
+++ b/cmake/modules/FindPythonLibrary.cmake
@@ -58,8 +58,13 @@ if (PYTHONINTERP_FOUND)
     if(INSTALL_PYTHON_FILES_IN_PYTHON_PREFIX)
         set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR})
     else()
-        set(PYTHON_SITE_PACKAGES_INSTALL_DIR \
                ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/python${PYTHON_SHORT_VERSION}/site-packages
-            CACHE PATH "The directory where Python modules will be installed to.")
+        execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; \
print(get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}'))" +                        OUTPUT_VARIABLE \
PYTHON_SITE_PACKAGES_INSTALL_DIR +                        OUTPUT_STRIP_TRAILING_WHITESPACE
+                       )
+    endif()
+
+    if(NOT PYTHON_SITE_PACKAGES_INSTALL_DIR STREQUAL PYTHON_SITE_PACKAGES_DIR)
         message(STATUS "The Python files will be installed to ${PYTHON_SITE_PACKAGES_INSTALL_DIR}. Make \
sure to add them to the Python search path (e.g. by setting PYTHONPATH)")  endif()
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic