Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/FindPythonLibrary.cmake
Context not available. | |||||
12 | # PYTHON_LONG_VERSION - The version of the Python interpreter found as a human | 12 | # PYTHON_LONG_VERSION - The version of the Python interpreter found as a human | ||
---|---|---|---|---|---|
13 | # readable string. | 13 | # readable string. | ||
14 | # | 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. | 15 | # PYTHON_SITE_PACKAGES_DIR - Location of the Python site-packages directory. | ||
21 | # | 16 | # | ||
22 | # PYTHON_INCLUDE_PATH - Directory holding the python.h include file. | 17 | # PYTHON_INCLUDE_PATH - Directory holding the python.h include file. | ||
Context not available. | |||||
34 | 29 | | |||
35 | if (PYTHONINTERP_FOUND) | 30 | if (PYTHONINTERP_FOUND) | ||
36 | 31 | | |||
37 | option(INSTALL_PYTHON_FILES_IN_PYTHON_PREFIX "Install the Python files in the Python packages dir" FALSE) | | |||
38 | | ||||
39 | # Set the Python libraries to what we actually found for interpreters | 32 | # Set the Python libraries to what we actually found for interpreters | ||
40 | set(Python_ADDITIONAL_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") | 33 | set(Python_ADDITIONAL_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") | ||
41 | # These are kept for compatibility | 34 | # These are kept for compatibility | ||
Context not available. | |||||
55 | ) | 48 | ) | ||
56 | 49 | | |||
57 | message(STATUS "Python system site-packages directory: ${PYTHON_SITE_PACKAGES_DIR}") | 50 | message(STATUS "Python system site-packages directory: ${PYTHON_SITE_PACKAGES_DIR}") | ||
58 | if(INSTALL_PYTHON_FILES_IN_PYTHON_PREFIX) | | |||
59 | set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR}) | | |||
60 | else() | | |||
61 | execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}'))" | | |||
62 | OUTPUT_VARIABLE PYTHON_SITE_PACKAGES_INSTALL_DIR | | |||
63 | OUTPUT_STRIP_TRAILING_WHITESPACE | | |||
64 | ) | | |||
65 | endif() | | |||
66 | | ||||
67 | if(NOT PYTHON_SITE_PACKAGES_INSTALL_DIR STREQUAL PYTHON_SITE_PACKAGES_DIR) | | |||
68 | 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)") | | |||
69 | endif() | | |||
70 | 51 | | |||
71 | endif(PYTHONINTERP_FOUND) | 52 | endif(PYTHONINTERP_FOUND) | ||
72 | 53 | | |||
Context not available. |