From 424619adfbeaf79a0b4c1e4c3011aa45d2967901 Mon Sep 17 00:00:00 2001 From: Marcos David Dione Date: Sat, 9 May 2009 16:37:59 +0000 Subject: this patch honors -DPYTHON_SITE_PACKAGES_DIR. if not set, then checks for -DPYTHON_LIBS_WITH_KDE_LIBS. if set, it installs python modules in kde's lib dir; if not, it installs them in python's dir, which is the default. svn path=/trunk/KDE/kdelibs/; revision=965738 --- modules/FindPythonLibrary.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'modules/FindPythonLibrary.cmake') diff --git a/modules/FindPythonLibrary.cmake b/modules/FindPythonLibrary.cmake index 80f3f4ab..d98cb621 100644 --- a/modules/FindPythonLibrary.cmake +++ b/modules/FindPythonLibrary.cmake @@ -3,12 +3,12 @@ # Find the Python interpreter and related Python directories. # # This file defines the following variables: -# +# # PYTHON_EXECUTABLE - The path and filename of the Python interpreter. # # PYTHON_SHORT_VERSION - The version of the Python interpreter found, # excluding the patch version number. (e.g. 2.5 and not 2.5.1)) -# +# # PYTHON_LONG_VERSION - The version of the Python interpreter found as a human # readable string. # @@ -43,7 +43,13 @@ else(EXISTS PYTHON_LIBRARY) STRING(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" PYTHON_SHORT_VERSION ${python_config}) STRING(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" PYTHON_LONG_VERSION ${python_config}) STRING(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" PYTHON_INCLUDE_PATH ${python_config}) - STRING(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" PYTHON_SITE_PACKAGES_DIR ${python_config}) + if(NOT PYTHON_SITE_PACKAGES_DIR) + if(NOT PYTHON_LIBS_WITH_KDE_LIBS) + STRING(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" PYTHON_SITE_PACKAGES_DIR ${python_config}) + else(NOT PYTHON_LIBS_WITH_KDE_LIBS) + set(PYTHON_SITE_PACKAGES_DIR ${KDE4_LIB_INSTALL_DIR}/python${PYTHON_SHORT_VERSION}/site-packages) + endif(NOT PYTHON_LIBS_WITH_KDE_LIBS) + endif(NOT PYTHON_SITE_PACKAGES_DIR) STRING(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION}) set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT}) if(WIN32) -- cgit v1.2.1