[CMake] New warnings in CMake 2.8.4-rc2

Emmanuel Blot eblot.ml at gmail.com
Fri Feb 18 17:48:44 EST 2011


---------- Forwarded message ----------
From: Emmanuel Blot <eblot.ml at gmail.com>
Date: Fri, Feb 18, 2011 at 11:48 PM
Subject: Re: [CMake] New warnings in CMake 2.8.4-rc2
To: David Cole <david.cole at kitware.com>


> If a variable is not used, then simply do not define it on the cmake
> command line.

Thanks, but I simply can't. If I could, I would have done it since 2.8.4-RC1 ;-)

Basically, we call several CMake projects from the same shell scripts,
and each CMake invokation receive the same set of global parameters.
The same way you can invoke a compiler with several -D options and
safely ignore the definitions you do not care about. Or the same way
you can place as many variables as you want in the environment and let
a program decides whether it "wants" to use it or not. I'm looking for
the same feature for CMake. I used to do it with -D option switch, it
seems I can't do it anymore.

> The other option is simply to ignore all of our "was not used" output.
> They are only warnings. They do not actually affect the generated
> build tree.

But we just don't want warnings. False warnings simply distract the
developer that have no choice but start ignoring them - and fail to
detect real and useful ones.

> I guess I don't understand your "big picture" here. It seems to me
> that it should be easy to resolve this one way or another, even if
> it's not pretty and elegant.

Sure. I'm just looking to invoke CMake with a set of variables, some
of which being useful for a given CMake script, some others being
safely ignored - as they used to be, BTW. How to do this?

"make" accepts a random list of definitions:
 make key1=value1 key2=value2 ...

"gcc" accepts a random list of definitions:
 gcc -DKEY1=value1 -DKEY2=value2

What is the equivalent way of passing such arguments to a CMake script ?

Thanks
Emmanuel.


More information about the CMake mailing list