Repository: qpid-proton Updated Branches: refs/heads/master c5555dd80 -> b984d5ac0
PROTON-1472: install to standard python site-packages under PREFIX Make symlink from old, non-standard "proton/bindings/python" location. Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/b984d5ac Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/b984d5ac Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/b984d5ac Branch: refs/heads/master Commit: b984d5ac0a9d319cc27010ba89e5a583d287626e Parents: 4be3a07 Author: Alan Conway <[email protected]> Authored: Wed May 3 14:11:14 2017 -0400 Committer: Alan Conway <[email protected]> Committed: Wed May 3 14:28:36 2017 -0400 ---------------------------------------------------------------------- proton-c/bindings/python/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b984d5ac/proton-c/bindings/python/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/bindings/python/CMakeLists.txt b/proton-c/bindings/python/CMakeLists.txt index f8c9241..f4d72ed 100644 --- a/proton-c/bindings/python/CMakeLists.txt +++ b/proton-c/bindings/python/CMakeLists.txt @@ -49,18 +49,26 @@ set_target_properties(${SWIG_MODULE_cproton_REAL_NAME} find_package(PythonInterp REQUIRED) if (CHECK_SYSINSTALL_PYTHON) + # Install to python_lib in prefix of PYTHON_EXECUTABLE (NOT the CMAKE_INSTALL PREFIX) execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" OUTPUT_VARIABLE PYTHON_SITEARCH_PACKAGES_DEFAULT OUTPUT_STRIP_TRAILING_WHITESPACE) else () - set (PYTHON_SITEARCH_PACKAGES_DEFAULT ${BINDINGS_DIR}/python) + # Install to python_lib location under CMAKE_INSTALL_PREFIX + execute_process(COMMAND + ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}'))" + OUTPUT_VARIABLE PYTHON_SITEARCH_PACKAGES_DEFAULT + OUTPUT_STRIP_TRAILING_WHITESPACE) endif () if (NOT PYTHON_SITEARCH_PACKAGES) set (PYTHON_SITEARCH_PACKAGES ${PYTHON_SITEARCH_PACKAGES_DEFAULT}) endif() +# Symlink old non-standard install location to the actual install location +install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${PYTHON_SITEARCH_PACKAGES} ${CMAKE_INSTALL_PREFIX}/${BINDINGS_DIR}/python)") + set (pysrc-generated cproton.py) set (pysrc proton/__init__.py --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
