[Cmake] Using CMake to build MEX files for Matlab

Andy Cedilnik andy.cedilnik at kitware.com
Wed Jan 8 11:28:33 EST 2003


Hi Gareth,

Well, you can always put all the mex stuff in subdirectory.

As I said before, CMake 1.6 solves this. You can do things like:

SET_TARGET_PROPERTIES(library PROPERTIES LINK_FLAGS "-foobar")
SET_TARGET_PROPERTIES(library PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(library PROPERTIES POSTFIX ".mexglx")

This will however only work unix and other Makefile based build systems
for now.

			Andy

On Wed, 2003-01-08 at 11:17, gareth.jones at stud.man.ac.uk wrote:
> Thank you for the suggestion, but I don't think it solves the problem
> because it still leaves the MEX linker arguments being passed to
> non-MEX share libraries.  I think this is a more general problem than
> just for MEX files because any time one builds more than one shared
> library in a directory one may want to pass seperate linker arguments,
> perhaps to set the versioning for the symbols or for some other
> reason.
> 
> Also, the reason for preferring changing the _LIBRARY_SUFFIX and
> _PREFIX is that adding the custom command means that MEX file does not
> get deleted by "make clean" -- adding another custom command for the
> "clean" target doesn't seem to solve this.  (I'm not sure about what
> happens when installing because I've not got that far yet.)
> 
> I would be interested to know the easy way with CMake 1.6 because that
> is what I am using.  Creating a MEX file is sufficiently involved that
> it makes sense to use a macro, which I believe are not supported in
> previous versions of CMake.





More information about the CMake mailing list