[CMake] New warnings in CMake 2.8.4-rc2

David Cole david.cole at kitware.com
Wed Feb 2 11:53:28 EST 2011


On Wed, Feb 2, 2011 at 11:46 AM, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2011/2/2 Bill Hoffman <bill.hoffman at kitware.com>:
>> On 2/2/2011 11:14 AM, Emmanuel Blot wrote:
>>>>
>>>> Currently, there is no way to turn this off.
>>>
>>> Very, very bad news ;-(
>>> IMHO, this is a recurrent issue with CMake. It seems the
>>
>> I was wrong.  Please read Brad King's posts on this, and then see if it
>> answers your questions.
>
> I think nothing has been switch ON by default **but** the check of command
> line defined  options, as Brad said:
>
>>> - 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.
>
> Now frankly I still agree that the default should be to switch it OFF and
> put it ON using a new policy and/or switch it ON using
>  --warn-unused-cli
>
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> _______________________________________________
> 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
>

Normally, I would agree with you that new features should be OFF by
default, and explicitly activated. But with this particular feature,
it would be utterly useless if it was OFF by default.

It's a *warning* about unused command line variables (and it's only a
warning, people, feel free to ignore it if you like -- it does no
harm, and changes no behavior -- ignore it if you're not willing to
avoid it).

There are 2 ways to avoid this new warning with CMake 2.8.4:
- reference all variables passed in on the command line (after all, if
it's not referenced, why pass it in?)
- use the new "--no-warn-unused-cli" command line option to avoid the warning

The other way to avoid the warning is to continue using CMake 2.8.3 or earlier.


David


More information about the CMake mailing list