| 12 |
# PYTHON_LONG_VERSION - The version of the Python interpreter found as a human |
# PYTHON_LONG_VERSION - The version of the Python interpreter found as a human |
| 13 |
# readable string. |
# readable string. |
| 14 |
# |
# |
| 15 |
|
# PYTHON_SITE_PACKAGES_INSTALL_DIR - this cache variable can be used for installing |
| 16 |
|
# own python modules. You may want to adjust this to be the |
| 17 |
|
# same as ${PYTHON_SITE_PACKAGES_DIR}, but then admin |
| 18 |
|
# privileges may be required for installation. |
| 19 |
|
# |
| 20 |
# PYTHON_SITE_PACKAGES_DIR - Location of the Python site-packages directory. |
# PYTHON_SITE_PACKAGES_DIR - Location of the Python site-packages directory. |
| 21 |
# |
# |
| 22 |
# PYTHON_INCLUDE_PATH - Directory holding the python.h include file. |
# PYTHON_INCLUDE_PATH - Directory holding the python.h include file. |
| 51 |
string(REGEX REPLACE ".*exec_prefix:([^\n]+).*$" "\\1" PYTHON_PREFIX ${python_config}) |
string(REGEX REPLACE ".*exec_prefix:([^\n]+).*$" "\\1" PYTHON_PREFIX ${python_config}) |
| 52 |
string(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" PYTHON_SHORT_VERSION ${python_config}) |
string(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" PYTHON_SHORT_VERSION ${python_config}) |
| 53 |
string(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" PYTHON_LONG_VERSION ${python_config}) |
string(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" PYTHON_LONG_VERSION ${python_config}) |
| 54 |
string(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" PYTHON_INCLUDE_PATH ${python_config}) |
|
| 55 |
if(NOT PYTHON_SITE_PACKAGES_DIR) |
string(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" _TMP_PYTHON_INCLUDE_PATH ${python_config}) |
| 56 |
if(NOT PYTHON_LIBS_WITH_KDE_LIBS) |
string(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" _TMP_PYTHON_SITE_PACKAGES_DIR ${python_config}) |
| 57 |
string(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" PYTHON_SITE_PACKAGES_DIR ${python_config}) |
|
| 58 |
else(NOT PYTHON_LIBS_WITH_KDE_LIBS) |
# Put these two variables in the cache so they are visible for the user, but read-only: |
| 59 |
set(PYTHON_SITE_PACKAGES_DIR ${KDE4_LIB_INSTALL_DIR}/python${PYTHON_SHORT_VERSION}/site-packages) |
set(PYTHON_INCLUDE_PATH "${_TMP_PYTHON_INCLUDE_PATH}" CACHE PATH "The python include directory" FORCE) |
| 60 |
endif(NOT PYTHON_LIBS_WITH_KDE_LIBS) |
set(PYTHON_SITE_PACKAGES_DIR "${_TMP_PYTHON_SITE_PACKAGES_DIR}" CACHE PATH "The python site packages dir" FORCE) |
| 61 |
endif(NOT PYTHON_SITE_PACKAGES_DIR) |
|
| 62 |
|
# This one is intended to be used and changed by the user for installing own modules: |
| 63 |
|
set(PYTHON_SITE_PACKAGES_INSTALL_DIR lib/python${PYTHON_SHORT_VERSION}/site-packages CACHE PATH "The directory where python modules will be installed to.") |
| 64 |
|
|
| 65 |
string(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION}) |
string(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION}) |
| 66 |
set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT}) |
set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT}) |
| 67 |
if(WIN32) |
if(WIN32) |