[CMake] Read Windows Registry value

Eric Noulard eric.noulard at gmail.com
Mon Feb 9 10:28:56 EST 2009


2009/2/9 elizabeta petreska <elizabeta.petreska at gmail.com>:
> Hello
> I am trying to read MatlabRoot from Registry ,so I can use it in my include
> and lib paths.
> like this :
> GET_FILENAME_COMPONENT(MATLAB_ROOT_PATH
>  [HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT] ABSOLUTE)
> message(${MATLAB_ROOT_PATH})

I don't think you need the GET_FILENAME_COMPONENT.
Would yuo try:

SET(MATLAB_ROOT_PATH
[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT])
MESSAGE("MATLAB_ROOT_PATH = ${MATLAB_ROOT_PATH}")


-- 
Erk


More information about the CMake mailing list