aboutsummaryrefslogtreecommitdiff
path: root/vmime-master/examples/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'vmime-master/examples/CMakeLists.txt')
-rw-r--r--vmime-master/examples/CMakeLists.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/vmime-master/examples/CMakeLists.txt b/vmime-master/examples/CMakeLists.txt
new file mode 100644
index 0000000..9e6998f
--- /dev/null
+++ b/vmime-master/examples/CMakeLists.txt
@@ -0,0 +1,38 @@
+
+IF(VMIME_BUILD_SAMPLES)
+
+ ADD_SUBDIRECTORY(viewer)
+
+ FILE(
+ GLOB
+ VMIME_SAMPLES_SRC_FILES
+ ${CMAKE_SOURCE_DIR}/examples/*.cpp
+ )
+
+ # Build one file for each sample
+ FOREACH(VMIME_SAMPLE_SRC_FILE ${VMIME_SAMPLES_SRC_FILES})
+
+ GET_FILENAME_COMPONENT(VMIME_SAMPLE_NAME "${VMIME_SAMPLE_SRC_FILE}" NAME_WE)
+
+ ADD_EXECUTABLE(
+ ${VMIME_SAMPLE_NAME}
+ ${VMIME_SAMPLE_SRC_FILE}
+ )
+
+ TARGET_LINK_LIBRARIES(
+ ${VMIME_SAMPLE_NAME}
+ ${VMIME_LIBRARY_NAME}
+ )
+
+ ADD_DEPENDENCIES(
+ ${VMIME_SAMPLE_NAME}
+ ${VMIME_LIBRARY_NAME}
+ )
+
+ ENDFOREACH()
+
+ELSE()
+
+ MESSAGE(FATAL_ERROR "Examples are not to be built (set VMIME_BUILD_SAMPLES to YES.")
+
+ENDIF()