summaryrefslogtreecommitdiff
path: root/examples/cmdline/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cmdline/CMakeLists.txt')
-rw-r--r--examples/cmdline/CMakeLists.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/cmdline/CMakeLists.txt b/examples/cmdline/CMakeLists.txt
new file mode 100644
index 0000000..922c2d8
--- /dev/null
+++ b/examples/cmdline/CMakeLists.txt
@@ -0,0 +1,33 @@
+##################################################################################
+# These are some examples. If you want examples to be built, you need to define
+# SWORD_BUILD_EXAMPLES="Yes". These will not be installed, so don't worry about
+# that.
+#
+SET(example_PROGRAMS
+ listoptions
+ lookup
+ outplain
+ outrender
+ search
+ verserangeparse
+)
+
+FOREACH(DEMO ${example_PROGRAMS})
+ ADD_EXECUTABLE("${DEMO}" "${DEMO}.cpp")
+ TARGET_LINK_LIBRARIES("${DEMO}" sword)
+ENDFOREACH(DEMO ${example_PROGRAMS})
+
+##################################################################################
+# This example uses pthreads explicity. I don't know if it supports anything else,
+# but until I find out, I will force it to find PTHREADS only
+#
+
+FIND_PACKAGE(Threads)
+
+IF(CMAKE_USE_PTHREADS_INIT OR CMAKE_HP_PTHREADS_INIT)
+ ADD_EXECUTABLE(threaded_search threaded_search.cpp)
+ TARGET_LINK_LIBRARIES(threaded_search
+ sword
+ ${CMAKE_THREAD_LIBS_INIT}
+ )
+ENDIF(CMAKE_USE_PTHREADS_INIT OR CMAKE_HP_PTHREADS_INIT)