[ENH] WinRegistry: Module for Windows Registry manipulation
Today, there is no facility to interact with Windows
registry. The only possibility is to use the undocumented capability of get_filename_component
which is problematic:
- it is undocumented
- restricted capabilities
- the command name does not match with the functionality
So, offering a CMake
module will enable a more complete and well documented Windows
registry.
A module seems more adequate than a new command because:
-
Windows
offers a tool to manipulate the registry:reg.exe
, so easy to interact with it fromCMake
- It is always problematic to introduce a new command except if it starts with
cmake_
but in this case it makes no sense and can introduce confusion becauseCMake
has also a concept of registry.
Possible operations are:
Query
win_registry(QUERY <key> [ENTRIES] [GLOB <glob>] [TYPE <type>] [CASE_SENSITIVE]
[RECURSE] [REG (32|64)] [RESULT <result>] <var>)
win_registry(QUERY <key> [ENTRY (<name>|DEFAULT)] [SEPARATOR <sep>]
[REG (32|64)] [RESULT <result>] <var>)
win_registry(EXIST <key> [ENTRY <name>] [REG (32|64)] <var>)
Edition
win_registry(ADD <key> [ENTRY (<name>|DEFAULT)] [VALUE <data>] [TYPE <type>]
[SEPARATOR <sep>] [REG (32|64)] [FORCE] [RESULT <result>])
win_registry(DELETE <key> [ENTRY (<name>|DEFAULT|ALL)] [REG (32|64)]
[RESULT <result>])
Import/Export
win_registry(EXPORT <key> [ENTRY (<name>|DEFAULT|ALL)] OUTPUT_FILE <output-file>
[OVERWRITE] [RESULT <result>])
win_registry(IMPORT <file> [RESULT <result>])