[CMake] FindMatlab.cmake suggestion

Crni Gorac cgorac at gmail.com
Mon Sep 28 14:41:00 EDT 2009


On Mon, Sep 28, 2009 at 6:37 PM, Alexander Neundorf
<a.neundorf-work at gmx.net> wrote:
> On Monday 28 September 2009, Crni Gorac wrote:
>> Could you please add a possibility to specify Matlab root installation
>> directory, through an environment variable, to FindMatlab.cmake
>> module?  For example, for non-Windows platforms, following line could
>> be added after line 50 of FindMatlab.cmake (and, of course, alike line
>> would be needed below, say after line 58 of the same file, for 64-bit
>> case):
>>     $ENV{MATLAB_DIR}/bin/glnx86/
>> Many other modules have alike possibility (it should be probably made
>> some kind of standard between modules), and the hard-coded list of
>> possible paths is simply too narrow).
>
> You can also set the CMAKE_PREFIX_PATH env.var. so that it contains
> MATLAB_DIR, this should help too.
>
> Alex
>

Yes, it could be done this way, but Matlab actually has non-standard
layout for include/lib directories, so both CMAKE_INCLUDE_PATH and
CMAKE_LIBRARY_PATH have to get employed.  But more importantly, this
way the knowledge of this and other (like names of 32/64 bit library
directories) stuff migrates from CMake module, where it belongs, to
the script the developer is sourcing in his shell in order to setup
the environment, and seems to me that this is really not the right
approach.


More information about the CMake mailing list