[Cmake] "IF EXISTS" with variable?

Brad King brad . king at kitware . com
Wed, 22 Oct 2003 09:01:20 -0400 (EDT)


On Wed, 22 Oct 2003, Bernhard Zach wrote:

> Hi all,
> I'm a newby with CMake but I hope you I can get your help.
>
> I want to include a File which can be an two possible places.
> It works fine, if I hardcode the filename, but I have to use a variable:
>
> "IF (EXISTS ${UtilsFile})"
> The result is:
> "IF An IF command had incorrect arguments: EXISTS ${UtilsFile}"

How is UtilsFile set?  I suspect it has more than one value listed in it.
Variable references are automatically expanded into zero or more arguments
depending on the number of values listed in the variable.  The EXISTS test
requires zero or one arguments.

-Brad