https://github.com/Kitware/CMake
Raw File
Tip revision: 0ecd9de6ddcaf951968d053ae491949d68d6175f authored by Brad King on 24 February 2021, 15:08:43 UTC
CMake 3.19.6
Tip revision: 0ecd9de
TOUCH.cmake
set(file "${CMAKE_CURRENT_BINARY_DIR}/file-to-touch")

file(REMOVE "${file}")
file(TOUCH_NOCREATE "${file}")
if(EXISTS "${file}")
  message(FATAL_ERROR "error: TOUCH_NOCREATE created a file!")
endif()

file(TOUCH "${file}")
if(NOT EXISTS "${file}")
  message(FATAL_ERROR "error: TOUCH did not create a file!")
endif()
file(REMOVE "${file}")

file(TOUCH)
file(TOUCH_NOCREATE)
back to top