[Insight-users] Re: ITK Wrappers and gcc_xml

Brad King brad.king at kitware.com
Wed Feb 15 09:45:12 EST 2006


Zachary Pincus wrote:
> Specifically, gcc_xml can emulate different compilers (e.g. MSVC++,  gcc 
> of different versions, etc). Now, ITK contains some compiler- specific 
> code (e.g. with regard to how threads are handled, etc.). As  such, any 
> attempt to wrap this compiler-specific code with gcc_xml  should be 
> accompanied by setting gcc_xml up to emulate the compiler  that will 
> actually be compiling the wrappers. Anything otherwise  would result in 
> wrappers that can't be compiled with the host compiler.
> 
> However, I see no provisions for this in the actual ITK wrappers. Is  
> this because no compiler-dependent code is being wrapped?

This is probably because CableSwig has typically been built by the same 
compiler as ITK, especially when it is in the tree.  The default 
compiler GCC-XML uses is the one with which it was built.

> Regardless of that, the WrapITK wrappers that Gaetan and I have been  
> working on does attempt to wrap compiler-generated code. Thus, I  would 
> love to be able to figure out a reliable way to configure  gcc_xml to 
> emulate whatever compiler is selected in/by cmake. Does  anyone have any 
> ideas?

In the GCCXML_CREATE_XML_FILE macro the command line for gcc-xml is 
constructed.  The include path is loaded via a file specified by the 
--gccxml-gcc-options argument.  You can add the argument 
--gccxml-compiler to specify the name of the compiler to simulate.  For 
most generators the value of ${CMAKE_CXX_COMPILER} can be used.  For 
Visual Studio generators one should use "msvc6", "msvc7", "msvc71", or 
"msvc8" to make sure the proper VS version is simulated.  Read the man 
page of gccxml (or gccxml --help) for more settings used to tune the 
simulation.

-Brad


More information about the Insight-users mailing list