From 1ca8c0e3a72f2002e21a65eb10eb3e6cdc420e82 Mon Sep 17 00:00:00 2001 From: "Darryl L. Pierce" Date: Fri, 23 Aug 2013 20:30:40 +0000 Subject: QPID-5064: Install Dispatch Python modules. Added a needed check for the Python interpreter so that the Cmake environment can then interrogate Python for the proper library path. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1517023 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/extras/dispatch/CMakeLists.txt | 58 +++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/qpid/extras/dispatch/CMakeLists.txt b/qpid/extras/dispatch/CMakeLists.txt index e0dbfcfc3f..d830782f72 100644 --- a/qpid/extras/dispatch/CMakeLists.txt +++ b/qpid/extras/dispatch/CMakeLists.txt @@ -6,9 +6,9 @@ ## to you under the Apache License, Version 2.0 (the ## "License"); you may not use this file except in compliance ## with the License. You may obtain a copy of the License at -## +## ## http://www.apache.org/licenses/LICENSE-2.0 -## +## ## Unless required by applicable law or agreed to in writing, ## software distributed under the License is distributed on an ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -24,6 +24,7 @@ include(CheckLibraryExists) include(CheckSymbolExists) include(CheckFunctionExists) include(CheckIncludeFiles) +include(FindPythonInterp) include(FindPythonLibs) enable_testing() @@ -52,6 +53,14 @@ set(SYSCONF_INSTALL_DIR etc CACHE PATH "System read only configuration directory set(SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory") set(MAN_INSTALL_DIR share/man CACHE PATH "Manpage directory") +# determine the location for installing the python packages +if (PYTHONLIBS_FOUND) + execute_process(COMMAND ${PYTHON_EXECUTABLE} + -c "from distutils.sysconfig import get_python_lib; print get_python_lib(False)" + OUTPUT_VARIABLE PYTHON_SITELIB_PACKAGES + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif (PYTHONLIBS_FOUND) + include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src @@ -108,6 +117,51 @@ file(GLOB headers "include/qpid/dispatch/*.h") install(FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR}/qpid/dispatch) install(FILES include/qpid/dispatch.h DESTINATION ${INCLUDE_INSTALL_DIR}/qpid) +## +## Python modules installation +## +set(PYTHON_STUBS_SOURCES + src/py/qpid/dispatch/stubs/__init__.py + src/py/qpid/dispatch/stubs/ioadapter.py + src/py/qpid/dispatch/stubs/logadapter.py +) + +set(PYTHON_ROUTER_SOURCES + src/py/qpid/dispatch/router/link.py + src/py/qpid/dispatch/router/router_engine.py + src/py/qpid/dispatch/router/__init__.py + src/py/qpid/dispatch/router/adapter.py + src/py/qpid/dispatch/router/mobile.py + src/py/qpid/dispatch/router/node.py + src/py/qpid/dispatch/router/routing.py + src/py/qpid/dispatch/router/data.py + src/py/qpid/dispatch/router/configuration.py + src/py/qpid/dispatch/router/neighbor.py + src/py/qpid/dispatch/router/path.py + src/py/qpid/dispatch/router/binding.py +) + +set(PYTHON_CONFIG_SOURCES + src/py/qpid/dispatch/config/parser.py + src/py/qpid/dispatch/config/__init__.py + src/py/qpid/dispatch/config/schema.py + src/py/qpid/dispatch/__init__.py +) + +install(FILES ${PYTHON_STUBS_SOURCES} + DESTINATION ${PYTHON_SITELIB_PACKAGES}/qpid/dispatch/stubs) + +install(FILES ${PYTHON_ROUTER_SOURCES} + DESTINATION ${PYTHON_SITELIB_PACKAGES}/qpid/dispatch/router) + +install(FILES ${PYTHON_CONFIG_SOURCES} + DESTINATION ${PYTHON_SITELIB_PACKAGES}/qpid/dispatch/config) + +install(FILES src/py/qpid/__init__.py + DESTINATION ${PYTHON_SITELIB_PACKAGES}/qpid) + +install(FILES src/py/qpid/dispatch/__init__.py + DESTINATION ${PYTHON_SITELIB_PACKAGES}/qpid/dispatch) ## ## Build Tests ## -- cgit v1.2.1