[Insight-users] improving windows support for FindMatlab.cmake

Ramón Casero Cañas rcasero at gmail.com
Fri Jun 10 08:08:08 EDT 2011


Hi,

The current FindMatlab.cmake fails to find Matlab in many cases, which 
is not a surprise, given the wide combination of Visual Studio and 
Matlab versions available.

I was thinking of how to improve it.

I'm not too sure whether an edited version of

<SNIPPET>
SET(MATLAB_ROOT 
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc60")
</SNIPPET>

would work (I need to do more testing), but at least the way below [1] 
reads the registry variable correctly

<SNIPPET>
GET_FILENAME_COMPONENT(MATLABROOT
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.11;MATLABROOT]"
ABSOLUTE
)
</SNIPPET>

The problem is that for each Matlab version, we get a different number, e.g.

2007a -> 7.4
2007b -> 7.5
2008b -> 7.7
2010b -> 7.11

Is there are way to do this in a more general way?


[1] http://www.cmake.org/pipermail/cmake/2007-August/015729.html

Best regards,

Ramon.

-- 
Dr. Ramón Casero Cañas

Computational Biology
Department of Computer Science
University of Oxford
Wolfson Building, Parks Rd
Oxford OX1 3QD

tlf     +44 (0) 1865 610737
web     http://web.comlab.ox.ac.uk/people/Ramon.CaseroCanas
photos  http://www.flickr.com/photos/rcasero/


More information about the Insight-users mailing list