[CMake] Use of $$ in filenames

Scott MacVicar macvicar at facebook.com
Mon Mar 1 23:40:23 EST 2010


On Mar 1, 2010, at 8:17 PM, Bill Hoffman wrote:

> Scott MacVicar wrote:
>> Hi,
>> 
>> With some auto-generated code we use $$ in filenames to avoid
> collisions withe files of the same name, within dependency.make we get
> some unexpected behaviour.
>> 
>> Line of interest: CMakeFiles/program.dir/php/scone.cpp.o:
>> cls/sometestclass$$0.h
>> With make $$ has a special meaning for secondary expansion and resolves it to $
>> 
>> If I manually edit the file and make it $$$$0 then it works as expected.
>> 
>> Should this be reported as a bug? Also is there a way to get around this for now?
>> 
> Yup, looks like a bug.
> 
> As for a work around, can you change your code generator to use _ 
> instead of $?

I'll add a bug soon for this.

Workaround wise, changing the code generator isn't practical so sed and ADD_CUSTOM_COMMAND with PRE_BUILD it is. We only build on Linux at the moment so its not a problem in the short term.

sed -i -e 's/\$\$/\$\$\$\$/' <file>

Scott


More information about the CMake mailing list