2010-04-19 23:19:22 +08:00
|
|
|
file(GLOB examples_SRCS "*.cpp")
|
2007-12-21 18:35:00 +08:00
|
|
|
|
2010-04-19 23:19:22 +08:00
|
|
|
foreach(example_src ${examples_SRCS})
|
|
|
|
get_filename_component(example ${example_src} NAME_WE)
|
|
|
|
add_executable(${example} ${example_src})
|
|
|
|
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
|
|
|
target_link_libraries(${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
|
|
|
|
endif()
|
|
|
|
add_custom_command(
|
|
|
|
TARGET ${example}
|
|
|
|
POST_BUILD
|
2014-08-22 18:13:07 +08:00
|
|
|
COMMAND ${example}
|
2010-04-19 23:19:22 +08:00
|
|
|
ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out
|
|
|
|
)
|
|
|
|
add_dependencies(all_examples ${example})
|
2019-11-01 00:36:27 +08:00
|
|
|
endforeach()
|
2016-09-23 04:27:54 +08:00
|
|
|
|
|
|
|
if(EIGEN_COMPILER_SUPPORT_CPP11)
|
|
|
|
ei_add_target_property(nullary_indexing COMPILE_FLAGS "-std=c++11")
|
|
|
|
endif()
|