Kitware/CMake — pull request #50 by shramov (2013-06-20 13:59:30+00:00)
Title: 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

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

``` make
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).