Brian Silverman | 72890c2 | 2015-09-19 14:37:37 -0400 | [diff] [blame] | 1 | file(GLOB examples_SRCS "*.cpp") |
| 2 | |
| 3 | foreach(example_src ${examples_SRCS}) |
| 4 | get_filename_component(example ${example_src} NAME_WE) |
| 5 | add_executable(${example} ${example_src}) |
| 6 | if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) |
| 7 | target_link_libraries(${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) |
| 8 | endif() |
| 9 | add_custom_command( |
| 10 | TARGET ${example} |
| 11 | POST_BUILD |
| 12 | COMMAND ${example} |
| 13 | ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out |
| 14 | ) |
| 15 | add_dependencies(all_examples ${example}) |
Austin Schuh | c55b017 | 2022-02-20 17:52:35 -0800 | [diff] [blame^] | 16 | endforeach() |
Austin Schuh | 189376f | 2018-12-20 22:11:15 +1100 | [diff] [blame] | 17 | |
Austin Schuh | 189376f | 2018-12-20 22:11:15 +1100 | [diff] [blame] | 18 | if(EIGEN_COMPILER_SUPPORT_CPP11) |
| 19 | ei_add_target_property(nullary_indexing COMPILE_FLAGS "-std=c++11") |
| 20 | endif() |