MantisBT - CMake
View Issue Details
0014237CMakeCMakepublic2013-06-20 10:012013-12-02 08:51
Pavel Shramov 
Brad King 
normalmajoralways
closedfixed 
 
CMake 2.8.12CMake 2.8.12 
0014237: Generated dependency paths may be too long for projects with relative includes
When cmake calculates dependencies for C/C++ files with relative include clauses result paths are constructed with simple append header_path + '/' + inner_header_path.

This leads to depend file like

CMakeFiles/test.dir/test.c.o: ../s1/../s2/f2.h
CMakeFiles/test.dir/test.c.o: ../s1/../s2/s2.2/../../s3/f3.h
CMakeFiles/test.dir/test.c.o: ../s1/../s2/s2.2/f2.2.h
CMakeFiles/test.dir/test.c.o: ../s1/f1.h

instead of

CMakeFiles/test.dir/test.c.o: ../s1/f1.h
CMakeFiles/test.dir/test.c.o: ../s2/f2.h
CMakeFiles/test.dir/test.c.o: ../s2/s2.2/f2.2.h
CMakeFiles/test.dir/test.c.o: ../s3/f3.h

With long chain of includes it may result in broken makefiles with paths larger then MAXPATH on win32 (260 chars).
No tags attached.
tgz relative.tgz (833) 2013-06-20 10:02
https://public.kitware.com/Bug/file/4797/relative.tgz
patch 7c61c73f+0001-cmDependsC-Collapse-relative-include-paths.patch (4,274) 2013-06-26 10:18
https://public.kitware.com/Bug/file/4802/7c61c73f%2B0001-cmDependsC-Collapse-relative-include-paths.patch
Issue History
2013-06-20 10:01Pavel ShramovNew Issue
2013-06-20 10:02Pavel ShramovFile Added: relative.tgz
2013-06-20 10:02Pavel ShramovNote Added: 0033355
2013-06-26 10:18Brad KingFile Added: 7c61c73f+0001-cmDependsC-Collapse-relative-include-paths.patch
2013-06-26 10:19Brad KingNote Added: 0033384
2013-06-27 04:36Pavel ShramovNote Added: 0033393
2013-07-01 09:52Brad KingNote Added: 0033439
2013-07-01 09:52Brad KingAssigned To => Brad King
2013-07-01 09:52Brad KingStatusnew => resolved
2013-07-01 09:52Brad KingResolutionopen => fixed
2013-07-01 09:52Brad KingFixed in Version => CMake 2.8.12
2013-07-01 09:52Brad KingTarget Version => CMake 2.8.12
2013-12-02 08:51Robert MaynardNote Added: 0034625
2013-12-02 08:51Robert MaynardStatusresolved => closed

Notes
(0033355)
Pavel Shramov   
2013-06-20 10:02   
To reproduce - decompress attached archive, run make

Pull request on github: https://github.com/Kitware/CMake/pull/50 [^]
(0033384)
Brad King   
2013-06-26 10:19   
This looks like a good fix. Based on your pull request I created the attached "7c61c73f+0001-cmDependsC-Collapse-relative-include-paths.patch". Please try it out.
(0033393)
Pavel Shramov   
2013-06-27 04:36   
Works for me.
(0033439)
Brad King   
2013-07-01 09:52   
Thanks for testing it. Applied:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=551d3343 [^]
(0034625)
Robert Maynard   
2013-12-02 08:51   
Closing resolved issues that have not been updated in more than 4 months.