[Cmake] "IF EXISTS" with variable?

Bernhard Zach bzach at hyperwave . com
Wed, 22 Oct 2003 15:25:20 +0200


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

Thank you!

The Problem was a simple space in my "SET" command:
"SET(UtilsFile ${PrivateRootDir} /config)"
Instead of
"SET(UtilsFile ${PrivateRootDir}/config)"

Thanks,
Bernhard