[CMake] How to set compiler flags?

fatman at crackmonkey.us fatman at crackmonkey.us
Fri Oct 1 05:17:04 EDT 2010


On Fri, 1 Oct 2010 11:05:34 +0200
Michael Wild <themiwi at gmail.com> wrote:
> > 
> > if(CMAKE_BUILD_TYPE EQUAL Debug)
> >   set(CMAKE_CXX_FLAGS -Wno-long-long -Wno-comment -Wwrite-strings
> > -std=c++0x -pedantic-errors -pedantic -Wall -W -g -gdwarf-2 -Weffc++
> > -Wmain -Wextra)
> > else(CMAKE_BUILD_TYPE EQUAL Debug)
> >   set(CMAKE_CXX_FLAGS -s etc)
> > endif(CMAKE_BUILD_TYPE EQUAL Debug)
> 
> The problem with this is that the cache makes the promise to the user
> that he can change the flags and you break it.

Sorry, I didn't understand that. I'm new to CMake. I'll go read up on
the cache now.

If I'm the only user, is this a problem?

Regards,
Adam J Richardson


More information about the CMake mailing list