[CMake] New warnings in CMake 2.8.4-rc2

Bill Hoffman bill.hoffman at kitware.com
Wed Feb 2 10:54:20 EST 2011


On 2/2/2011 9:59 AM, Micha Renner wrote:
> Am Mittwoch, den 02.02.2011, 09:12 -0500 schrieb Bill Hoffman:
>> On 2/2/2011 6:10 AM, Micha Renner wrote:
>>> Am Mittwoch, den 02.02.2011, 12:00 +0100 schrieb Emmanuel Blot:
>>>> Hello,
>>>>
>>>> How to disable the new warnings CMake 2.8.4-rc2 emits, such as the
>>>> following ones?
>>>
>>> I support this question too.
>>>
>>> There should be a way to switch off this feature of CMake, especially
>>> when variables are used uninitialized.
>>>
>>
>> Currently, there is no way to turn this off.  Are the warnings valid?
> In my case not. My approach was uninitialized variables do not hurt.
> An example (pseudo code):
> The first thing I do is a platform check.
> IF(MSVC)
> 	UseAndFind(TLIBWIN)
> ELSEIF(APPLE)
> 	UseAndFind(TLIBQUARTZ)
> ELSEIF(UNIX)
> 	UseAndFind(TLIBUNIX)
> END()
>
> Then somewhere in the build-tree:
> 	TARGET_LINK_LIBRARIES(tm ${TLIBWIN} ${TLIBQUARTZ} ${TLIBUNIX})
> That was a simple solution.
>
> It would be interesting to see, what your CMakeLists(Version 1.0) file
> says :)

It should not warn about that by default.  It only warns by default for 
unused variables passed on the command line.

-Bill


More information about the CMake mailing list