CMake/Tests/RunCMake/file/timeout-script.cmake
Ruslan Baratov e6db4c5a4e file: Add LOCK subcommand to do file and directory locking
Provide options to fail without blocking or to block up to a timeout.
Provide options to specify the scope containing the lock so it can be
released automatically at the end of a function, file, or process.

Extend the RunCMake.file test with cases covering the file(LOCK) command
usage and error cases.
2014-12-03 09:47:44 -05:00

6 lines
116 B
CMake

if(NOT file_to_lock)
message(FATAL_ERROR "file_to_lock is empty")
endif()
file(LOCK "${file_to_lock}" TIMEOUT 1)