summaryrefslogtreecommitdiff
path: root/cpp/bindings/qmf2
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2013-02-28 16:14:30 +0000
committerKim van der Riet <kpvdr@apache.org>2013-02-28 16:14:30 +0000
commit9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 (patch)
tree2a890e1df09e5b896a9b4168a7b22648f559a1f2 /cpp/bindings/qmf2
parent172d9b2a16cfb817bbe632d050acba7e31401cd2 (diff)
downloadqpid-python-asyncstore.tar.gz
Update from trunk r1375509 through r1450773asyncstore
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/bindings/qmf2')
-rw-r--r--cpp/bindings/qmf2/CMakeLists.txt37
-rw-r--r--cpp/bindings/qmf2/Makefile.am1
-rw-r--r--cpp/bindings/qmf2/examples/cpp/Makefile.am11
-rw-r--r--cpp/bindings/qmf2/python/CMakeLists.txt31
-rw-r--r--cpp/bindings/qmf2/python/Makefile.am4
-rw-r--r--cpp/bindings/qmf2/python/python.i4
-rw-r--r--cpp/bindings/qmf2/qmf2.i66
-rw-r--r--cpp/bindings/qmf2/ruby/CMakeLists.txt6
-rw-r--r--cpp/bindings/qmf2/ruby/Makefile.am4
-rw-r--r--cpp/bindings/qmf2/ruby/ruby.i6
10 files changed, 34 insertions, 136 deletions
diff --git a/cpp/bindings/qmf2/CMakeLists.txt b/cpp/bindings/qmf2/CMakeLists.txt
deleted file mode 100644
index 5e40539e80..0000000000
--- a/cpp/bindings/qmf2/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# 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
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-include(FindSWIG)
-include(UseSWIG)
-include(FindRuby)
-include(FindPythonLibs)
-include(FindPerlLibs)
-
-if (SWIG_FOUND)
- set(CMAKE_SWIG_FLAGS "-w362,401")
-
- if (PYTHONLIBS_FOUND)
- add_subdirectory(python)
- endif (PYTHONLIBS_FOUND)
-
- if (RUBY_FOUND)
- add_subdirectory(ruby)
- endif (RUBY_FOUND)
-endif (SWIG_FOUND)
diff --git a/cpp/bindings/qmf2/Makefile.am b/cpp/bindings/qmf2/Makefile.am
index 9a03a5cd21..0f50e757a2 100644
--- a/cpp/bindings/qmf2/Makefile.am
+++ b/cpp/bindings/qmf2/Makefile.am
@@ -19,7 +19,6 @@
if HAVE_SWIG
-EXTRA_DIST = CMakeLists.txt qmf2.i
SUBDIRS = examples/cpp
if HAVE_RUBY_DEVEL
diff --git a/cpp/bindings/qmf2/examples/cpp/Makefile.am b/cpp/bindings/qmf2/examples/cpp/Makefile.am
index 062fbd0a85..8bf56ead91 100644
--- a/cpp/bindings/qmf2/examples/cpp/Makefile.am
+++ b/cpp/bindings/qmf2/examples/cpp/Makefile.am
@@ -21,16 +21,19 @@ INCLUDE = -I$(top_srcdir)/include
AM_CPPFLAGS = $(INCLUDE)
+TYPES_LIB=$(top_builddir)/src/libqpidtypes.la
+MESSAGING_LIB=$(top_builddir)/src/libqpidmessaging.la
+
noinst_PROGRAMS=agent event_driven_list_agents list_agents print_events
agent_SOURCES=agent.cpp
-agent_LDADD=$(top_builddir)/src/libqmf2.la
+agent_LDADD=$(top_builddir)/src/libqmf2.la $(TYPES_LIB) $(MESSAGING_LIB)
list_agents_SOURCES=list_agents.cpp
-list_agents_LDADD=$(top_builddir)/src/libqmf2.la
+list_agents_LDADD=$(top_builddir)/src/libqmf2.la $(MESSAGING_LIB)
event_driven_list_agents_SOURCES=event_driven_list_agents.cpp
-event_driven_list_agents_LDADD=$(top_builddir)/src/libqmf2.la
+event_driven_list_agents_LDADD=$(top_builddir)/src/libqmf2.la $(MESSAGING_LIB)
print_events_SOURCES=print_events.cpp
-print_events_LDADD=$(top_builddir)/src/libqmf2.la
+print_events_LDADD=$(top_builddir)/src/libqmf2.la $(TYPES_LIB) $(MESSAGING_LIB)
diff --git a/cpp/bindings/qmf2/python/CMakeLists.txt b/cpp/bindings/qmf2/python/CMakeLists.txt
index 2e71ca34e7..1c8447116e 100644
--- a/cpp/bindings/qmf2/python/CMakeLists.txt
+++ b/cpp/bindings/qmf2/python/CMakeLists.txt
@@ -21,7 +21,7 @@
## Use Swig to generate a literal binding to the C++ API
##------------------------------------------------------
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES CPLUSPLUS ON)
-set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include")
+set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include;-I${qpid-cpp_SOURCE_DIR}/bindings")
swig_add_module(cqmf2_python python ${CMAKE_CURRENT_SOURCE_DIR}/python.i)
swig_link_libraries(cqmf2_python qmf2 ${PYTHON_LIBRARIES})
@@ -31,28 +31,23 @@ set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_F
##------------------------------------
## Install the complete Python binding
##------------------------------------
-execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cqmf2.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cqmf2.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/qmf2.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmf2.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmf2.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.py
- ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.pyc
- ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.pyo
- ${CMAKE_CURRENT_BINARY_DIR}/qmf2.py
- ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pyc
- ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pyo
- DESTINATION ${PYTHON_SITE_PACKAGES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/qmf2.py
+ DESTINATION ${PYTHON_SITEARCH_PACKAGES}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_cqmf2_python.so
RENAME _cqmf2.so
- DESTINATION ${PYTHON_SITE_PACKAGES}
+ DESTINATION ${PYTHON_SITEARCH_PACKAGES}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
+# Python compile the installed modules
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cqmf2.py
+ WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cqmf2.py
+ WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmf2.py
+ WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmf2.py
+ WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
diff --git a/cpp/bindings/qmf2/python/Makefile.am b/cpp/bindings/qmf2/python/Makefile.am
index 591c1408c0..309e8f8dad 100644
--- a/cpp/bindings/qmf2/python/Makefile.am
+++ b/cpp/bindings/qmf2/python/Makefile.am
@@ -19,7 +19,7 @@
if HAVE_PYTHON_DEVEL
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_builddir)/src $(QMF_INCLUDES)
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/bindings -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_builddir)/src $(QMF_INCLUDES)
generated_file_list = \
cqmf2.cpp \
@@ -29,7 +29,7 @@ EXTRA_DIST = CMakeLists.txt python.i
BUILT_SOURCES = $(generated_file_list)
SWIG_FLAGS = -w362,401
-$(generated_file_list): $(srcdir)/python.i $(srcdir)/../qmf2.i $(srcdir)/../../swig_python_typemaps.i
+$(generated_file_list): $(srcdir)/python.i
$(SWIG) -c++ -python $(SWIG_FLAGS) $(INCLUDES) $(QPID_CXXFLAGS) -I/usr/include -o cqmf2.cpp $(srcdir)/python.i
pylibdir = $(pyexecdir)
diff --git a/cpp/bindings/qmf2/python/python.i b/cpp/bindings/qmf2/python/python.i
index 02dd1632b0..6b5326f8cf 100644
--- a/cpp/bindings/qmf2/python/python.i
+++ b/cpp/bindings/qmf2/python/python.i
@@ -19,7 +19,7 @@
%module cqmf2
%include "std_string.i"
-%include "../../swig_python_typemaps.i"
+%include "qpid/swig_python_typemaps.i"
/* Define the general-purpose exception handling */
%exception {
@@ -37,5 +37,5 @@
}
}
-%include "../qmf2.i"
+%include "qmf/qmf2.i"
diff --git a/cpp/bindings/qmf2/qmf2.i b/cpp/bindings/qmf2/qmf2.i
deleted file mode 100644
index 0f573fe3e6..0000000000
--- a/cpp/bindings/qmf2/qmf2.i
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * 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
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-%{
-
-#include <qmf/exceptions.h>
-#include <qmf/AgentEvent.h>
-#include <qmf/Agent.h>
-#include <qmf/AgentSession.h>
-#include <qmf/ConsoleEvent.h>
-#include <qmf/ConsoleSession.h>
-#include <qmf/DataAddr.h>
-#include <qmf/Data.h>
-#include <qmf/Query.h>
-#include <qmf/Schema.h>
-#include <qmf/SchemaId.h>
-#include <qmf/SchemaMethod.h>
-#include <qmf/SchemaProperty.h>
-#include <qmf/SchemaTypes.h>
-#include <qmf/Subscription.h>
-
-%}
-
-%include <qpid/ImportExport.h>
-%include <qpid/messaging/ImportExport.h>
-%include <qpid/messaging/Duration.h>
-
-%include <qmf/ImportExport.h>
-%include <qmf/exceptions.h>
-%include <qmf/AgentEvent.h>
-%include <qmf/Agent.h>
-%include <qmf/AgentSession.h>
-%include <qmf/ConsoleEvent.h>
-%include <qmf/ConsoleSession.h>
-%include <qmf/DataAddr.h>
-%include <qmf/Data.h>
-%include <qmf/Query.h>
-%include <qmf/Schema.h>
-%include <qmf/SchemaId.h>
-%include <qmf/SchemaMethod.h>
-%include <qmf/SchemaProperty.h>
-%include <qmf/SchemaTypes.h>
-%include <qmf/Subscription.h>
-
-%{
-
-using namespace qmf;
-
-%};
-
diff --git a/cpp/bindings/qmf2/ruby/CMakeLists.txt b/cpp/bindings/qmf2/ruby/CMakeLists.txt
index 1cb969f7dc..70b3e917f9 100644
--- a/cpp/bindings/qmf2/ruby/CMakeLists.txt
+++ b/cpp/bindings/qmf2/ruby/CMakeLists.txt
@@ -22,7 +22,9 @@
##------------------------------------------------------
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON)
-include_directories(${RUBY_INCLUDE_DIRS} ${qpid-cpp_SOURCE_DIR}/include)
+include_directories(${RUBY_INCLUDE_DIRS}
+ ${qpid-cpp_SOURCE_DIR}/include
+ ${qpid-cpp_SOURCE_DIR}/bindings)
swig_add_module(cqmf2_ruby ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i)
swig_link_libraries(cqmf2_ruby qmf2 ${RUBY_LIBRARY})
@@ -32,7 +34,7 @@ swig_link_libraries(cqmf2_ruby qmf2 ${RUBY_LIBRARY})
##----------------------------------
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqmf2_ruby.so
RENAME cqmf2.so
- DESTINATION ${RUBY_ARCH_DIR}
+ DESTINATION ${RUBY_PFX_ARCH_DIR}
COMPONENT ${QPID_COMPONENT_CLIENT}
)
diff --git a/cpp/bindings/qmf2/ruby/Makefile.am b/cpp/bindings/qmf2/ruby/Makefile.am
index a03bd6d5e6..9952edb972 100644
--- a/cpp/bindings/qmf2/ruby/Makefile.am
+++ b/cpp/bindings/qmf2/ruby/Makefile.am
@@ -19,7 +19,7 @@
if HAVE_RUBY_DEVEL
-INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_builddir)/src $(QMF_INCLUDES)
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/bindings -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_builddir)/src $(QMF_INCLUDES)
EXTRA_DIST = CMakeLists.txt ruby.i
BUILT_SOURCES = cqmf2.cpp
@@ -27,7 +27,7 @@ SWIG_FLAGS = -w362,401
rubylibdir = $(RUBY_LIB)
-cqmf2.cpp: $(srcdir)/ruby.i $(srcdir)/../qmf2.i $(srcdir)/../../swig_ruby_typemaps.i
+cqmf2.cpp: $(srcdir)/ruby.i
$(SWIG) -ruby -c++ $(SWIG_FLAGS) $(INCLUDES) $(QPID_CXXFLAGS) -I/usr/include -o cqmf2.cpp $(srcdir)/ruby.i
rubylibarchdir = $(RUBY_LIB_ARCH)
diff --git a/cpp/bindings/qmf2/ruby/ruby.i b/cpp/bindings/qmf2/ruby/ruby.i
index 1070c65a44..0254017555 100644
--- a/cpp/bindings/qmf2/ruby/ruby.i
+++ b/cpp/bindings/qmf2/ruby/ruby.i
@@ -18,8 +18,10 @@
*/
%module cqmf2
+/* Ruby doesn't have a != operator*/
+#pragma SWIG nowarn=378
%include "std_string.i"
-%include "../../swig_ruby_typemaps.i"
+%include "qpid/swig_ruby_typemaps.i"
/* Define the general-purpose exception handling */
%exception {
@@ -32,4 +34,4 @@
}
}
-%include "../qmf2.i"
+%include "qmf/qmf2.i"