generate-once.cmake 236 B

12345678
  1. if (${CMAKE_ARGC} LESS 4)
  2. message(FATAL_ERROR "Too few arguments")
  3. endif()
  4. set(output "${CMAKE_ARGV3}")
  5. if(EXISTS ${output})
  6. message(FATAL_ERROR "${output} already exists")
  7. endif()
  8. file(WRITE ${output} "int main() { return 0; }\n")