summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/add_custom_command/generate-once.cmake
blob: 2a8e8433ebb3ccea02fed49bf9cc4626b9d162a1 (plain)
1
2
3
4
5
6
7
8
if (${CMAKE_ARGC} LESS 4)
  message(FATAL_ERROR "Too few arguments")
endif()
set(output "${CMAKE_ARGV3}")
if(EXISTS ${output})
  message(FATAL_ERROR "${output} already exists")
endif()
file(WRITE ${output} "int main() { return 0; }\n")