[CMake] Managing warning level

Brandon J. Van Every bvanevery at gmail.com
Sat Mar 25 05:35:21 EST 2006


jbd wrote:
> I'm wondering how to manage the warning level of a compilation
> process. Do i have to do some ugly IF(WIN32) foobar ? I'd like to do
> it the abstract way, since i need to compile on windows with mingw, visual 
> and on GNU/Linux using gcc.

That's only 2 cases.  Use IF(CMAKE_COMPILER_IS_GNUCC) and IF(MSVC).  At 
least, these are available in CMake 2.3.  If you have more compilers 
than that, then the question is whether warning levels are abstractable 
across many different compilers.  Dunno myself, I've only had to worry 
about GCC and MSVC.


Cheers,
Brandon Van Every



More information about the CMake mailing list