MantisBT - CMake
View Issue Details
0014547CMakeCMakepublic2013-11-06 07:402016-06-10 14:31
Hajime Yoshimori 
Kitware Robot 
normalminoralways
closedmoved 
CMake 2.8.12 
 
0014547: Unix Makefile generator won't escape '#'
The Unix Makefile generator won't escape '#' which is appeared in names of dependent files.

If we have a header file named like "P#HEADER", CMake dependency generator will output the name without escaping.

Then it will occurs a dependency error because there is not a file named like "P".
(This test case requires FORTRAN compiler.)

1. Extract "test-case.tar.gz"
2. cd to "test"
3. make directory "build"
4. cd to "build"
5. cmake .. -G 'Unix Makefiles'
6. make

Outputs following: (Using GNU Make)
  make[2]: *** No rule to make target `../P', needed by `CMakeFiles/A.dir/A.F.o'. Stop.

Outputs following: (Using Solaris Make)
  make: Fatal error in reader: CMakeFiles/A.dir/depend.make, line 4: Unexpected comment seen

It also occurs in any place where user inputted (target names, compile options, additional library names, and so on).
No tags attached.
related to 0015285closed  Cannot escape "#" in add_compile_options 
related to 0015070closed Brad King CMake doesn't escape # properly in add_compile_options with Makefile generator 
gz test-case.tar.gz (401) 2013-11-06 07:40
https://public.kitware.com/Bug/file/4938/test-case.tar.gz
Issue History
2013-11-06 07:40Hajime YoshimoriNew Issue
2013-11-06 07:40Hajime YoshimoriFile Added: test-case.tar.gz
2014-12-04 14:44Brad KingRelationship addedrelated to 0015285
2014-12-04 14:48Brad KingRelationship addedrelated to 0015070
2015-05-27 09:07Jesper MattssonNote Added: 0038806
2016-06-10 14:29Kitware RobotNote Added: 0042413
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0038806)
Jesper Mattsson   
2015-05-27 09:07   
Same problem applies to '$' as well, e.g. when a source file contains '#include "file$name.h"'.
(0042413)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.