cmake/Tests/RunCMake/add_custom_command/generate-once.cmake
2018-08-09 18:06:22 +02:00

9 lines
236 B
CMake

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")