[cmake-developers] New command 'file(LOCK_DIRECTORY ...)'

Ruslan Baratov ruslan_baratov at yahoo.com
Sun Oct 5 16:59:08 EDT 2014


Hi,

I have CMake modules that can share resources between different 
instances. For now I manage it by invoking `mkdir 
<shared-dir>/lock-directory` and checking the result, then removing this 
directory so the next instance can do the modification. The problem 
occurs when somebody terminate CMake. Since I can't set handler (e.g. 
SIGINT) to CMake, directory will not be removed and will be "locked" 
forever.

So it can't be resolved without some low-level management. I'm thinking 
about `file` command sub-option like LOCK_DIRECTORY: 
`file(LOCK_DIRECTORY "/path/to/shared-dir")`. Does it sounds doable?

Thanks, Ruslo



More information about the cmake-developers mailing list