From 92190a1cafc3a8613e1200cd4ed81dbc509a93bd Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 7 Jan 2014 20:23:35 +0100 Subject: Add an example showing how to use C++11 random distributions --- doc/special_examples/CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'doc/special_examples/CMakeLists.txt') diff --git a/doc/special_examples/CMakeLists.txt b/doc/special_examples/CMakeLists.txt index 0c9b3c3ba..45e2339e3 100644 --- a/doc/special_examples/CMakeLists.txt +++ b/doc/special_examples/CMakeLists.txt @@ -19,3 +19,22 @@ if(QT4_FOUND) add_dependencies(all_examples Tutorial_sparse_example) endif(QT4_FOUND) + +check_cxx_compiler_flag("-std=c++11" EIGEN_COMPILER_SUPPORT_CPP11) +if(EIGEN_COMPILER_SUPPORT_CPP11) + add_executable(random_cpp11 random_cpp11.cpp) + target_link_libraries(random_cpp11 ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) + add_dependencies(all_examples random_cpp11) + ei_add_target_property(random_cpp11 COMPILE_FLAGS "-std=c++11") + + get_target_property(random_cpp11_exec + random_cpp11 LOCATION) + add_custom_command( + TARGET random_cpp11 + POST_BUILD + COMMAND ${random_cpp11_exec} + ARGS >${CMAKE_CURRENT_BINARY_DIR}/random_cpp11.out + ) + + +endif() \ No newline at end of file -- cgit v1.2.3