[CMake] Read Windows Registry value

Eric Noulard eric.noulard at gmail.com
Mon Feb 9 11:42:38 EST 2009

2009/2/9 elizabeta petreska <elizabeta.petreska at gmail.com>:
> Still not working.
> I am getting the following :

My first suggestion was silly.
Message may print this but registry read may be OK.

You'll find attached an example of registry usage which works here
(CMake 2.6.0 on Windows XP):

cmake -P registry.cmake
gives the following output:

D:\Test>cmake -P registry.cmake
SEVENZIP_ROOT = C:/Program Files/7-Zip
HELPFILE = C:/Program Files/7-Zip

as you can see the registry is read by FIND_PATH and GET_FILENAME_COMPONENT
but a simple "message" does not evaluate the registry value.

When I try with your MATLAB registry entry I get:

D\Test>cmake -P registry.cmake
MYROOT = /registry

Which seems to be the behaviour you observe.
In my case this is logical since I have no matlab installed on my machine.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: registry.cmake
Type: application/octet-stream
Size: 467 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090209/558521b4/attachment-0001.obj>

More information about the CMake mailing list