[cmake-developers] Limitations of IS_ABSOLUTE

Mathias Gaunard mathias.gaunard at ens-lyon.org
Mon Dec 24 06:06:08 EST 2012


On 21/12/12 11:19, Alan W. Irwin wrote:
> On 2012-12-21 09:43+0100 Eric Noulard wrote:
>
>> 2012/12/21 Alan W. Irwin
>> <irwin-ICHe1znInSgulI1VNbnaeCwD8/FfD2ys at public.gmane.org>:
>>>  Obviously for my use case it does look like a
>>> reasonable alternative is to use file(GLOB...) followed by a check of
>>> the result variable to see if it is empty.  But implementation of an
>>> additional IF subcommand called IS_FILE which just checks for the
>>> existence of the specified file would do this in fewer lines and does
>>
>> Precisely the purpose of
>> if(EXISTS ${file})
>>
>> I think.
>
> Thanks, Eric.  EXISTS is what I needed.
>
> I still think adding the qualifying phrase "if it exists or not" to the
> IS_ABSOLUTE documentation would be useful.

I'd rather IS_ABSOLUTE did not force the file to exist.
I use it to check if some paths are absolute, regardless of whether they 
exist.




More information about the cmake-developers mailing list