[CMake] New warnings in CMake 2.8.4-rc2

Brad King brad.king at kitware.com
Wed Feb 2 09:49:27 EST 2011


On 2/2/2011 9:21 AM, Michael Jackson wrote:
> On Feb 2, 2011, at 9:08 AM, Brad King wrote:
>> 
>> cmake --help:
>> 
>>  --warn-uninitialized        = Warn about uninitialized values.
>>  --warn-unused-vars          = Warn about unused variables.
>>  --no-warn-unused-cli        = Don't warn about command line options.
> 
> So does the -warn-uninitialized ENABLE or DISABLE the new warnings?

It does what the documentation says (enable).  Bill's answer
was incorrect unless he was referring to something else.  There
are three cases:

- User passes -DCMAKE_BIULD_TYPE on the command line and gets a warning
because it is misspelled and therefore unused.  This is ON by default
but can be disabled with --no-warn-unused-cli, or by *gasp* not passing
unused variables.

- Project does ${UNINITIALIZED_VAR} and nothing happens, but it can
be a warning if --warn-uninitialized is passed.  This is intended to
help cleanup project source code.

- Project does set(VAR_THAT_IS_NOT_USED 1) and nothing happens, but
can be a warning if --warn-unused-vars is passed.

-Brad


More information about the CMake mailing list