AddCustomCommandWithArg.cmake 445 B

123456789101112131415
  1. enable_language(C)
  2. set(CMAKE_CROSSCOMPILING 1)
  3. # Executable: Return error code different from 0
  4. add_executable(generated_exe_emulator_expected simple_src_exiterror.c)
  5. add_custom_command(OUTPUT output
  6. COMMAND generated_exe_emulator_expected
  7. COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/output
  8. DEPENDS generated_exe_emulator_expected)
  9. add_custom_target(ensure_build ALL
  10. SOURCES
  11. ${CMAKE_CURRENT_BINARY_DIR}/output
  12. )