summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/CMakeLists.txt3
-rw-r--r--cpp/examples/CMakeLists.txt51
-rw-r--r--cpp/examples/direct/CMakeLists.txt22
-rw-r--r--cpp/examples/failover/CMakeLists.txt22
-rw-r--r--cpp/examples/fanout/CMakeLists.txt21
-rw-r--r--cpp/examples/pub-sub/CMakeLists.txt21
-rw-r--r--cpp/examples/qmf-console/CMakeLists.txt23
-rw-r--r--cpp/examples/request-response/CMakeLists.txt21
-rw-r--r--cpp/examples/tradedemo/CMakeLists.txt22
-rw-r--r--cpp/examples/xml-exchange/CMakeLists.txt22
10 files changed, 227 insertions, 1 deletions
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 13ed89a5c0..2d17303b91 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -35,7 +35,6 @@ add_subdirectory(managementgen)
add_subdirectory(src)
# add_subdirectory(docs/api)
# add_subdirectory(docs/man)
-#add_subdirectory(examples)
# if (WIN32)
# do something Microsoft specific
@@ -45,3 +44,5 @@ add_subdirectory(src)
install(FILES LICENSE NOTICE README SSL RELEASE_NOTES DESIGN
xml/cluster.xml INSTALL-WINDOWS
DESTINATION .)
+
+add_subdirectory(examples)
diff --git a/cpp/examples/CMakeLists.txt b/cpp/examples/CMakeLists.txt
new file mode 100644
index 0000000000..c8c9910466
--- /dev/null
+++ b/cpp/examples/CMakeLists.txt
@@ -0,0 +1,51 @@
+#
+# 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.
+#
+project(qpidc_examples)
+cmake_minimum_required(VERSION 2.4.0 FATAL_ERROR)
+if(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+endif(COMMAND cmake_policy)
+
+# This will probably need some fiddling to get right for installed kits.
+get_directory_property(QPIDC_TOP PARENT_DIRECTORY)
+include_directories(${QPIDC_TOP}/src ${QPIDC_TOP}/src/gen)
+
+# There are numerous duplicate names within the examples. Since all target
+# names must be unique, define a macro to prepend a prefix and manage the
+# actual names.
+# There can be an optional arguments at the end: libs to include
+macro(add_example subdir example)
+ add_executable(${subdir}_${example} ${example}.cpp)
+ set_target_properties(${subdir}_${example} PROPERTIES OUTPUT_NAME ${example})
+ if (${ARGC} GREATER 2)
+ target_link_libraries(${subdir}_${example} ${ARGN} qpidclient)
+ else (${ARGC} GREATER 2)
+ target_link_libraries(${subdir}_${example} qpidclient)
+ endif (${ARGC} GREATER 2)
+endmacro(add_example)
+
+add_subdirectory(direct)
+add_subdirectory(failover)
+add_subdirectory(fanout)
+add_subdirectory(pub-sub)
+#add_subdirectory(qmf-agent)
+add_subdirectory(qmf-console)
+add_subdirectory(request-response)
+add_subdirectory(tradedemo)
+add_subdirectory(xml-exchange)
diff --git a/cpp/examples/direct/CMakeLists.txt b/cpp/examples/direct/CMakeLists.txt
new file mode 100644
index 0000000000..2ec1b2b813
--- /dev/null
+++ b/cpp/examples/direct/CMakeLists.txt
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+add_example(direct declare_queues)
+add_example(direct direct_producer)
+add_example(direct listener)
diff --git a/cpp/examples/failover/CMakeLists.txt b/cpp/examples/failover/CMakeLists.txt
new file mode 100644
index 0000000000..05db8fad51
--- /dev/null
+++ b/cpp/examples/failover/CMakeLists.txt
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+add_example(failover declare_queues)
+add_example(failover resuming_receiver)
+add_example(failover replaying_sender)
diff --git a/cpp/examples/fanout/CMakeLists.txt b/cpp/examples/fanout/CMakeLists.txt
new file mode 100644
index 0000000000..3f89d67650
--- /dev/null
+++ b/cpp/examples/fanout/CMakeLists.txt
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+
+add_example(fanout fanout_producer)
+add_example(fanout listener)
diff --git a/cpp/examples/pub-sub/CMakeLists.txt b/cpp/examples/pub-sub/CMakeLists.txt
new file mode 100644
index 0000000000..993a0a4214
--- /dev/null
+++ b/cpp/examples/pub-sub/CMakeLists.txt
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+
+add_example(pub_sub topic_listener)
+add_example(pub_sub topic_publisher)
diff --git a/cpp/examples/qmf-console/CMakeLists.txt b/cpp/examples/qmf-console/CMakeLists.txt
new file mode 100644
index 0000000000..faed82ef6d
--- /dev/null
+++ b/cpp/examples/qmf-console/CMakeLists.txt
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+
+add_example(console console qmfconsole)
+add_example(console printevents qmfconsole)
+add_example(console ping qmfconsole)
+add_example(console queuestats qmfconsole)
diff --git a/cpp/examples/request-response/CMakeLists.txt b/cpp/examples/request-response/CMakeLists.txt
new file mode 100644
index 0000000000..873a0cfa86
--- /dev/null
+++ b/cpp/examples/request-response/CMakeLists.txt
@@ -0,0 +1,21 @@
+#
+# 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.
+#
+
+add_example(request-response client)
+add_example(request-response server)
diff --git a/cpp/examples/tradedemo/CMakeLists.txt b/cpp/examples/tradedemo/CMakeLists.txt
new file mode 100644
index 0000000000..e61fc1467d
--- /dev/null
+++ b/cpp/examples/tradedemo/CMakeLists.txt
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+add_example(tradedemo topic_listener)
+add_example(tradedemo topic_publisher)
+add_example(tradedemo declare_queues)
diff --git a/cpp/examples/xml-exchange/CMakeLists.txt b/cpp/examples/xml-exchange/CMakeLists.txt
new file mode 100644
index 0000000000..ca4c7bcc28
--- /dev/null
+++ b/cpp/examples/xml-exchange/CMakeLists.txt
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+add_example(xml-exchange declare_queues)
+add_example(xml-exchange xml_producer)
+add_example(xml-exchange listener)