CMakeLists.txt 607 B

1234567891011121314151617181920
  1. file(GLOB examples_SRCS "*.cpp")
  2. foreach(example_src ${examples_SRCS})
  3. get_filename_component(example ${example_src} NAME_WE)
  4. add_executable(${example} ${example_src})
  5. if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
  6. target_link_libraries(${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
  7. endif()
  8. add_custom_command(
  9. TARGET ${example}
  10. POST_BUILD
  11. COMMAND ${example}
  12. ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out
  13. )
  14. add_dependencies(all_examples ${example})
  15. endforeach()
  16. if(EIGEN_COMPILER_SUPPORT_CPP11)
  17. ei_add_target_property(nullary_indexing COMPILE_FLAGS "-std=c++11")
  18. endif()