Notes |
|
(0014528)
|
RW Penney
|
2009-01-12 06:00
|
|
I too have been finding the existing FindMatlab.cmake within cmake-2.4 and cmake-2.6 to be rather restrictive, especially for cross-platform building of mex-files under win32/win64/linux environments.
In parallel with, and independently from Tom, I've been developing an alternative FindMatlab.cmake which I hope could be merged with the good ideas in Tom's scripts for use in a future version of cmake. |
|
|
(0020739)
|
mbauman
|
2010-05-14 11:30
|
|
rwpenny's marvelous replacement has languished here for over a year. It works very well and is a vast improvement over the default FindMatlab.cmake. I would love to see it incorporated into CMake. |
|
|
(0020741)
|
Bill Hoffman
|
2010-05-14 15:23
|
|
|
|
(0020790)
|
Tom Vercauteren
|
2010-05-19 05:26
|
|
If a maintainer volunteers, it would also be nice to have a macro to build mex files from cmake. Something along the lines of the attached MatlabMexMacro.cmake should work. |
|
|
(0026568)
|
Tom Vercauteren
|
2011-05-23 02:50
|
|
This issue is related to bug 0009240 |
|
|
(0026569)
|
Ramón Casero
|
2011-05-23 11:52
(edited on: 2011-05-23 12:00) |
|
I have uploaded file MatlabMakeMacros.cmake. This file is a slightly derived work of the Matlab macros found in the source code provided with
Dru F., Fillard P., Vercauteren T., "An ITK Implementation of the Symmetric Log-Domain Diffeomorphic Demons Algorithm", Insight Journal, 2009 Jan-Jun
http://hdl.handle.net/10380/3060 [^]
Our small modification allows to compile a mex file for a Linux 64 bit architecture. Our file lives here
http://code.google.com/p/gerardus/source/browse/tags/release-0.4.0/matlab/MatlabMakeMacros.cmake [^]
The diff of our change is the following:
Index: MatlabMakeMacros.cmake
===================================================================
--- MatlabMakeMacros.cmake (revision 316)
+++ MatlabMakeMacros.cmake (revision 343)
@@ -62,7 +62,13 @@
SD_APPEND_TARGET_PROPERTIES(${Target} COMPILE_FLAGS ${MATLAB_FLAGS})
SET_TARGET_PROPERTIES(${Target} PROPERTIES LINK_FLAGS "/export:mexFunction")
ELSE(MSVC)
- SET(MATLAB_FLAGS "-fPIC" "-D_GNU_SOURCE" "-pthread" "-D_FILE_OFFSET_BITS=64" "-DMX_COMPAT_32")
+ IF(CMAKE_SIZEOF_VOID_P MATCHES "4")
+ SET(MATLAB_FLAGS "-fPIC" "-D_GNU_SOURCE" "-pthread"
+ "-D_FILE_OFFSET_BITS=64" "-DMX_COMPAT_32")
+ ELSE(CMAKE_SIZEOF_VOID_P MATCHES "4")
+ SET(MATLAB_FLAGS "-fPIC" "-D_GNU_SOURCE" "-pthread"
+ "-D_FILE_OFFSET_BITS=64")
+ ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "4")
SD_APPEND_TARGET_PROPERTIES(${Target} COMPILE_FLAGS ${MATLAB_FLAGS})
IF(APPLE)
|
|
|
(0038758)
|
Raffi Enficiaud
|
2015-05-18 03:42
|
|
I believe the FindMatlab refactoring of the current CMake master branch (upcoming v3.3) addresses all those issues. |
|
|
(0038760)
|
Brad King
|
2015-05-18 09:04
|
|
|
|
(0039812)
|
Robert Maynard
|
2015-11-02 09:15
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|