You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
604 B

  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. get_target_property(example_executable
  9. ${example} LOCATION)
  10. add_custom_command(
  11. TARGET ${example}
  12. POST_BUILD
  13. COMMAND ${example_executable}
  14. ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out
  15. )
  16. add_dependencies(all_examples ${example})
  17. endforeach(example_src)