[CMake] Bug when $ is in the directory path

Peng Yu pengyu.ut at gmail.com
Mon Aug 13 09:46:22 EDT 2012


The offending line is this.

/tmp/$/build$ grep -H  -n '/tmp/$/src/tutorial.cpp'
CMakeFiles/tutorial.exe.dir/build.make
CMakeFiles/tutorial.exe.dir/build.make:53:CMakeFiles/tutorial.exe.dir/tutorial.cpp.o:
/tmp/$/src/tutorial.cpp

This is obviously a bug in cmake but not a bug in make, as special
treatment must be done for '$' in Makefile (see the following
example).

I hope that it is helpful to the development of cmake by providing
this kind of corner case test.

~/linux/test/gnu/make/$$ cat Makefile
.PHONY: all

all: ../$$/out.txt

../$$/out.txt: ../$$/in.txt
	cp $< $@

clean:
	$(RM) ../$$/out.txt
~/linux/test/gnu/make/$$ make clean
rm -f ../$/out.txt


Just in case my make and cmake are not the newest. And the bug has
been fixed in later version. Here are my make and cmake versions.

~/linux/test/gnu/make/$$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin10.0
~/linux/test/gnu/make/$$ cmake --version
cmake version 2.8.8


> First of all, this is not a bugtracker. If you want your bug fixed,
> you should file it in the kitware bugtracker.

It is nonetheless helpful to discuss it here. Obviously, you did not
think it is a bug. There are also previous bug discussions on this
mailing list.

-- 
Regards,
Peng


More information about the CMake mailing list