[CMake] CMake and Matlab

Tom Vercauteren tom.vercauteren at gmail.com
Mon Apr 19 04:56:39 EDT 2010


Hi all,

As a side note on this topic: It's not really necessary to use the
"mex" executables to build mex files. As far as I understand it, mex
files are just shared libraries. It should thus be possible to use
your usual c/c++ compiler to generate them. In this case, there is no
need to patch cmake.

On my linux 64 box, I have been using this to generate my mex files
from cmake with gcc. It's been a long time since I tested it on other
platforms but I recall that I had to make it work for gcc on linux 32,
gcc on linux 64 and either gcc on mac or msvc on windows (not sure
which one of these two actually works right now). The corresponding
modified FindMatlab.cmake files and ADD_MEX_FILE cmake macros can be
found here (look in SDCMakeMacros.cmake):
  http://hdl.handle.net/10380/3060
or here for the direct source code link
  http://www.midasjournal.org/download/sourcecode/644/4

It would be great if something along those lines could be added to
cmake. I should be able to help a little but cannot commit to
maintaining it.

Hope this helps,
Tom


More information about the CMake mailing list