[cmake-developers] Introduction and volunteering for the Matlab package

Brad King brad.king at kitware.com
Fri Feb 13 10:36:57 EST 2015


On 02/13/2015 09:43 AM, Raffi Enficiaud wrote:
>> * Why is Matlab_VERSION_STRING cached?  Shouldn't it be computed
>>  every time from the matlab that was found?
> 
> In case the version is not found with an obvious method
> (on OSX /Applications/MATLABVersion, on Win32, the version also is
> given by the registry key), we have to find the version of matlab
> by running matlab itself. I am caching the version once I have it
> to prevent any further execution of matlab for retrieving this
> information.

Okay.  Currently the value is user-facing, but it shouldn't ever be
edited manually, right?  Instead the detected version could be cached
in an INTERNAL cache entry.  Also there should be a second internal
entry that records which matlab program was executed to compute the
version.  If the latter does not match then the version should be
re-computed.

> In case a symlink of the binary called "matlab" exists in /usr/local/bin
> for instance, I need to retrieve the path of the libraries mex, mx etc,
> that are relative to the real installation path of matlab.

In that case I think you should look for those pieces relative to
the original executable location first, and if not found then
resolve symlinks into a temporary variable name and then use that.
The resolved path should not be made user-facing so that any user
that sets Matlab_MAIN_PROGRAM explicitly will see that value
persist.

Thanks,
-Brad



More information about the cmake-developers mailing list