[Insight-developers] List Windows registry sub-keys using CMake

Brad King brad.king at kitware.com
Tue Jun 14 08:49:57 EDT 2011


On 06/14/2011 08:28 AM, Dan Mueller wrote:
> Just wondering if it is possible to use CMake to list Windows registry sub-keys?
> 
> For example I have the following keys:
>     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.10.2]
>     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.8]
>     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.7]
>     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.4]
>     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.3]
>     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6.1]
>     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono\\2.6]
> 
> Is it possible to perform some form of globbing expression on
>     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Novell\\Mono]
> to find all the sub-keys e.g. 2.10.2, 2.8, 2.6.7, 2.6.4, 2.6.3, 2.6.1, 2.6?
> 
> At the moment I am simply testing known versions (which seems tedious
> and is not future proof).

Currently this is not possible.  It may be tricky to define an intuitive
but correct interface for this because registry keys may be named using
most glob meta-characters like '*', '[', ']', etc.  Furthermore, globbing
may not naturally define an ordering.

The same problem is faced when searching directory paths containing
version components.  Currently only find_package deals with that, and
then only for certain documented cases.

-Brad


More information about the Insight-developers mailing list