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

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Fri Jan 13 09:44:50 EST 2006


On Fri, 13 Jan 2006 14:33:55 +0100, William A. Hoffman  
<billlist at nycap.rr.com> wrote:

> 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.

That's why I also talk about a warning :-)

> Perhaps we need
> a special flag like perl has to check for this type of thing.
>

that would be really nice
It could also be a command line option which can be used to debug the  
project when something goes wrong

> 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.
>

That's not really what I want: I don't want to have to call a macro to do  
the check - I'd like cmake to do it each time it try to get the value of a  
variable.

It seems there is nothing like that for now in cmake, so I continue  
without it, but that would be nice to have it in next releases.

Gaetan



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the CMake mailing list