<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div>1. cmake:mex problem</div><div>According to the webpage (<a href="http://www.cmake.org/Wiki/CMake:MatlabMex" target="_blank" style="color: rgb(0, 101, 204); ">http://www.cmake.org/Wiki/CMake:MatlabMex</a>)</div>
<div>we can tell <span style="font-family: sans-serif; font-size: 13px; line-height: 19px; ">CMake (patched version) to treat the mex build script as the project's compiler which can be done by the command (</span><span style="font-family: monospace; font-size: 13px; line-height: 14px; white-space: pre-wrap; ">CC=mex CXX=mex cmake /path/to/project/source</span><span style="font-family: sans-serif; font-size: 13px; line-height: 19px; ">).</span></div>
<div><span style="font-family: sans-serif; font-size: 13px; line-height: 19px; ">For the examples they provided, it has no problem. It works perfectly fine. But when it comes to kvl code, it does not.</span></div><div><span style="font-family: sans-serif; font-size: 13px; line-height: 19px; "><br>
</span></div><div><font face="sans-serif"><span style="line-height: 19px; ">When I run the command: </span></font><span style="font-family: sans-serif; line-height: 19px; ">CC=/m/fs/software/matlab/r2010b/bin/mex CXX=/m/fs/software/matlab/r2010b/bin/mex ../../cmake-2.8.2/bin/cmake ../my project name</span></div>
<div><font face="sans-serif"><span style="line-height: 19px; "><div>-- Configuring done</div><div>-- Generating done</div><div>-- Build files have been written to: /my project path</div><div><br></div><div>After that, when I run "make", then I got following:</div>
</span></font></div><div><br></div><div><div>[ 0%] Building CXX object CMakeFiles/kvlAddBorder.dir/kvlAddBorder.o</div><div><br></div><div> mex: -ftemplate-depth-50 not a valid option.</div><div><br></div></div><div>
<div> Usage:</div><div> MEX [option1 ... optionN] sourcefile1 [... sourcefileN]</div><div> [objectfile1 ... objectfileN] [libraryfile1 ... libraryfileN]</div><div><br></div><div> Use the -help option for more information, or consult the MATLAB External Interfaces Guide.</div>
<div><br></div><div>make[2]: *** [CMakeFiles/kvlAddBorder.dir/kvlAddBorder.o] Error 1</div><div>make[1]: *** [CMakeFiles/kvlAddBorder.dir/all] Error 2</div><div>make: *** [all] Error 2</div></div><div><br></div><div>The problem is I cannot find any option of "-ftemplate-depth-50" anywhere in "mex".</div>
<div><br></div><div>The project uses ITK, VTK (built by CMake release mode), fltk, gmm, tetgen.</div><div><br></div><div>For all the above mentioned program, patched version of CMake was used.</div><div><br></div><div>What seems to be a problem?</div>
</span>