On Tue, Mar 2, 2010 at 11:36 AM, Alexander Neundorf <a.neundorf-w...@gmx.net> wrote: > On Tuesday 02 March 2010, J Decker wrote: >> I'd like to know why I have to do this at the end of each CMakeLists.txt... >> >> if( C++ ) >> set( CMAKE_C_COMPILER "${CMAKE_CXX_COMPILER}" ) >> set( CMAKE_C_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}" ) >> endif() > > in general, you shouldn't have to do this at all. > This is only for very exotic circumstances. > Why do you actually do that at all ? >
Actually there are properties on the source files to make this change rather than forcing it... but, I do it because there are features that compile better with C++. Although C Compilers often give me a way to hook into their runtime init (code that is run before main) it's easier (and more standard) to implement static classes that do the same deadstart initialization. Although the code is C, renaming all the files to C++ isn't really proper. Plus, the code will even compile with /CLR under visual studio and be 'managed', but that requires compilation as C++. > Alex > _______________________________________________ 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