On Tue, Jul 14, 2009 at 6:55 PM, Benjamin Schindler wrote: > Hi > > That workaround works - I've done it when I sent the initial mail. But I can > imagine various situation when this can become an issue as well (like when > writing compiler or platform specific code), so I posted it here anyway to > start a discussion. > I think the probing for defined macros like you do for the includes (that > makes things like heaven compared to <2.6.4!!) would solve it nicely IMHO.
Just to be clear... If you have compiler dependent code: #if defined(_MSC_VER) ... #elif defined(__GNUC__) ... #else ... #endif Then you could do something like the following in CMakeLists.txt: if (CMAKE_COMPILER_IS_GNUC) add_definitions(-DWORKING_WITH_GCC) # or use COMPILE_DEFINITIONS property elseif (MSVC) add_definitions(-DWORKING_WITH_MSVC) # or use COMPILE_DEFINITIONS property endif() and the code above would look like: #if defined(WORKING_WITH_MSVC) ... #elif defined(WORKING_WITH_GCC) ... #else ... #endif The only limitation that I see for compiler/platform specific stuff is that CMake needs to be able to differentiate somehow between them... right? or am I missing something else? --Miguel _______________________________________________ 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