CMakeLists.txt 556 B

12345678910111213141516171819
  1. add_custom_command(
  2. OUTPUT output1.txt
  3. COMMAND ${CMAKE_COMMAND} -E echo CustomCommand > output1.txt
  4. )
  5. add_custom_target(CustomTarget ALL DEPENDS output1.txt)
  6. add_custom_command(
  7. OUTPUT output2.txt
  8. COMMAND ${CMAKE_COMMAND} -E echo CustomCommand2 > output2.txt
  9. )
  10. add_custom_target(CustomTarget2 ALL DEPENDS output2.txt)
  11. add_custom_command(
  12. OUTPUT output3.txt
  13. COMMAND ${CMAKE_COMMAND} -E echo CustomCommand2 > output3.txt
  14. )
  15. add_custom_target(CustomTarget3 ALL DEPENDS output3.txt)
  16. add_custom_target(CustomTargetFail COMMAND DoesNotExist)