https://github.com/Kitware/CMake
Raw File
Tip revision: 2a5e5b25ba4d6eb68dbee29381774562c98e228f authored by Brad King on 30 October 2019, 13:44:41 UTC
CMake 3.15.5
Tip revision: 2a5e5b2
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