summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-05-23 12:59:36 -0700
committerGarrett D'Amore <garrett@damore.org>2018-05-23 12:59:36 -0700
commitd27d3b780ebe1b987d180773ea071fd6a89625a6 (patch)
tree3dbcb7a26dda9c38eb5f29ac54f00469ef8e3ec5
parentfbcd0616f54596020819782ddc257482f4f5f62a (diff)
downloadnanomsg-d27d3b780ebe1b987d180773ea071fd6a89625a6.tar.gz
fixes #975 Add CMakeLists for demos
-rw-r--r--demo/CMakeLists.txt29
-rw-r--r--demo/README3
2 files changed, 32 insertions, 0 deletions
diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt
new file mode 100644
index 0000000..4807f16
--- /dev/null
+++ b/demo/CMakeLists.txt
@@ -0,0 +1,29 @@
+#
+# Demonstration CMakeLists.txt for nanomsg demos.
+#
+# This file shows how one might use nanomsg from a another project
+# that is also CMake-driven.
+#
+# Thanks for the idea goes to @maddouri.
+#
+cmake_minimum_required (VERSION 2.8.7)
+
+project(nanomsg-demo)
+
+# Call this from your own project's makefile.
+find_package(nanomsg CONFIG REQUIRED)
+
+add_executable(async_demo async_demo.c)
+target_link_libraries(async_demo nanomsg)
+
+add_executable(device_demo device_demo.c)
+target_link_libraries(device_demo nanomsg)
+
+add_executable(pthread_demo pthread_demo.c)
+target_link_libraries(pthread_demo nanomsg)
+
+add_executable(pubsub_demo pubsub_demo.c)
+target_link_libraries(pubsub_demo nanomsg)
+
+add_executable(rpc_demo rpc_demo.c)
+target_link_libraries(rpc_demo nanomsg)
diff --git a/demo/README b/demo/README
index 4ee4cf8..dd0d164 100644
--- a/demo/README
+++ b/demo/README
@@ -3,3 +3,6 @@ The intention is that you can use these programs (or parts thereof) in
your own code.
We welcome further contributions here.
+
+These have their own CMake driven configuration if you want to build them
+all. They are not built automatically.