I saw a couple questions regarding this in the archives from a few
years, but no answers.
I am using CMake for my project, and would now like to write a matlab
mex function which would use my C/C++ code base. I'd like to have the
CMake infrastructure figure out the correct -I,-L,-l flags to pa
> ..., but what I want to do is compile a file
> for use in Matlab using the mex compiler. I can do this by hand by
> executing the following in a shell:
>
> $ mex foo.cpp
>
> This would produce a foo.mexglx binary which matlab would be able to use.
>
> This is great if your foo.cpp is self-co
Wojciech Jarosz wrote:
> I saw a couple questions regarding this in the archives from a few
> years, but no answers.
>
> I am using CMake for my project, and would now like to write a matlab
> mex function which would use my C/C++ code base. I'd like to have the
> CMake infrastructure figure out t
Brad King wrote:
FIND_PACKAGE(Matlab)
INCLUDE_DIRECTORIES(${MATLAB_INCLUDE_DIR})
ADD_LIBRARY(mymex MODULE mymex.c)
TARGET_LINK_LIBRARIES(mymex ${MATLAB_LIBRARIES})
See also "bin/cmake --help-module FindMatlab".
It looks like the matlab module is a bit out of date so let us know if
you have prob