Re-transfer, I did dropped the list
---------- Forwarded message ---------- From: Eric Noulard <eric.noul...@gmail.com> Date: 2009/3/19 Subject: Re: [CMake] controlling which instantiations to make for given templates To: Hicham Mouline <hic...@mouline.org> 2009/3/19 Hicham Mouline <hic...@mouline.org>: > Hello, > we have a number of projects, in some of them, we have translation units that > define member functions of template classes, > and at the bottom we have explicit template instantiations of those templates: > template class Templ<ArgList1>; > template class Templ<ArgList2>; > > it turns out under VS2005/2008 we only need the instantiation with > Templ<ArgList1> > while under gcc3 we need Templ<ArgList2> > > I saw some aux sources command in cmake that considers a "Template" subdir, > but we don't wish to use this method. > Is there any other feature of cmake to help with this? > Otherwise, we will use processor defines to test which env and then choose > the appropriate instantiation. I think that in this case compiler specific pre-defined MACRO is the way to go see: http://predef.sourceforge.net/precomp.html for gcc http://predef.sourceforge.net/precomp.html#sec14 and MSVC http://predef.sourceforge.net/precomp.html#sec34 CMake provides you with CMAKE_COMPILER_IS_GNUCC and MSVC* see http://www.cmake.org/Wiki/CMake_Useful_Variables#System_.26_Compiler_Information But then you'll have to CONFIGURE_FILE and/or ADD_DEFINITION in order select what you want. -- Erk -- Erk _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake