[CMake] How to read content of a registry entry on WIN32?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed May 7 11:42:05 EDT 2008


On 2008-05-07 15:37+0200 Eric Noulard wrote:

> I want to use the content of a regsitry entry
>
> HKEY_LOCAL_MACHINE\SOFTWARE\GnuWin32/InstallPath
>
> in order to use it in a FIND_PROGRAM , PATHS argument?
>
> find_program(LEX_PROGRAM
>                     NAMES flex lex
>                     PATHS
> "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\InstallPath]/bin"
>                     NO_DEFAULT_PATH
>                     DOC "A lex-compatible lexer generator")
>
> but this does not work?
>
> How can I do that?

There are a lot of examples of using HKEY_LOCAL_MACHINE in the CMake
modules.  From studying those (without any knowledge of the windows
registry) I cannot see what is wrong with the above, but maybe you will have
better luck spotting the problem given all the (presumably) working
examples.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list