[CMake] Re: [Insight-developers] can cmake generate an error if a variable doesn't exist ?

William A. Hoffman billlist at nycap.rr.com
Fri Jan 13 08:33:55 EST 2006


At 03:33 AM 1/13/2006, Gaetan Lehmann wrote:

>I was thinking to something like
>
>MESSAGE("VAR value is: ${VAR}")
>
>where VAR is not defined. I would like to get an error, or at least a  
>warning, instead of an empty value.

That would cause tremendous backwards compatibility problems.
It is almost certain that VTK, ITK, VXL, and almost any other large
cmake project would break if this was an error.  Perhaps we need
a special flag like perl has to check for this type of thing.

You can do this:

  IF(DEFINED variable)

True if the given variable is defined. It does not matter if the variable is true or false just if it has been set. 

So, you could make a macro that does what you want.

-Bill
  



More information about the CMake mailing list