summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarryl L. Pierce <mcpierce@apache.org>2013-08-23 20:30:40 +0000
committerDarryl L. Pierce <mcpierce@apache.org>2013-08-23 20:30:40 +0000
commit1ca8c0e3a72f2002e21a65eb10eb3e6cdc420e82 (patch)
tree383cea37ba547d1dfa6eebdae03fc845204befb5
parent50c2d7176511e88624dce3c152d3e64fc82aaea8 (diff)
downloadqpid-python-1ca8c0e3a72f2002e21a65eb10eb3e6cdc420e82.tar.gz
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
-rw-r--r--qpid/extras/dispatch/CMakeLists.txt58
1 files 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
@@ -109,6 +118,51 @@ 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
##
add_subdirectory(router)