aboutsummaryrefslogtreecommitdiff
path: root/unsupported/doc/examples/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'unsupported/doc/examples/CMakeLists.txt')
-rw-r--r--unsupported/doc/examples/CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/unsupported/doc/examples/CMakeLists.txt b/unsupported/doc/examples/CMakeLists.txt
new file mode 100644
index 000000000..978f9afd8
--- /dev/null
+++ b/unsupported/doc/examples/CMakeLists.txt
@@ -0,0 +1,22 @@
+FILE(GLOB examples_SRCS "*.cpp")
+
+ADD_CUSTOM_TARGET(unsupported_examples)
+
+INCLUDE_DIRECTORIES(../../../unsupported ../../../unsupported/test)
+
+FOREACH(example_src ${examples_SRCS})
+ GET_FILENAME_COMPONENT(example ${example_src} NAME_WE)
+ ADD_EXECUTABLE(example_${example} ${example_src})
+ if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
+ target_link_libraries(example_${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
+ endif()
+ GET_TARGET_PROPERTY(example_executable
+ example_${example} LOCATION)
+ ADD_CUSTOM_COMMAND(
+ TARGET example_${example}
+ POST_BUILD
+ COMMAND ${example_executable}
+ ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out
+ )
+ ADD_DEPENDENCIES(unsupported_examples example_${example})
+ENDFOREACH(example_src)