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

Raffi Enficiaud raffi.enficiaud at free.fr
Tue Feb 17 19:28:57 EST 2015


Dear Brad,

Please find attached a patch addressing the issues mentioned in your email.
The tests were failing because of the following modification:

-      matlab_get_version_from_matlab_run(${Matlab_MAIN_PROGRAM} matlab_list_of_all_versions)
+      matlab_get_version_from_matlab_run("${Matlab_MAIN_PROGRAM}" matlab_list_of_all_versions)

Apparently the quotes here are interpreted as part of the binary name, which prevents the proper call to matlab using the execute_process function.

I kept the symlink resolution, but I narrowed the case those should be resolved. I added a variable pointing to the (symlink resolved) location of the binary from which the version is retrieved. I compare paths symlink resolved for that purpose. I hope this is in line with what you would like to have.

Note that I only tested on LinuxLTS14.04 locally, I will test further tomorrow morning. 
I also changed the build path of the Windows agent, the build should be clear on Windows now.

Best regards,
Raffi Enficiaud

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Addressing-the-visibility-of-the-internal-variables-.patch
Type: application/octet-stream
Size: 9138 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150218/b1659497/attachment-0001.obj>
-------------- next part --------------

> On 13 Feb 2015, at 16:36, Brad King <brad.king at kitware.com> wrote:
> 
> 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