e6db4c5a4e
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.
7 lines
225 B
CMake
7 lines
225 B
CMake
set(lfile "${CMAKE_CURRENT_BINARY_DIR}/file-to-lock")
|
|
FILE(WRITE "${lfile}" "")
|
|
|
|
# Try to lock file '${lfile}/cmake.lock'. Since `lfile` is not a directory
|
|
# expected that operation will fail.
|
|
file(LOCK "${lfile}" DIRECTORY)
|