View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013938CMakeCMakepublic2013-02-20 11:032016-06-10 14:31
Reportertasptz 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformLinuxOSUbuntuOS Version12.04
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0013938: Incomplete header dependencies generated
DescriptionI constructed a minimal example which reproduces the issue.
The include tree is:

main.cpp -> a/a.h -> x.h (a.h includes x.h without path and x.h is in a/)
        \-> c/c.h -> x.h (c.h includes x.h without path and x.h is in c/)

Now cmake detects the dependency only for one of the two x.h!

Note:
I even added all files to the executable
add_executable(main main.cpp a/a.h a/x.h c/c.h c/x.h)
Steps To Reproduce1. Compile the project.
 * project build must be successful!
2. Change a/x.h and check if the change is picked up by the build system
3. Change c/x.h and check if the change is picked up by the build system

Either step 2 or step 3 should fail!
Additional InformationI ran the following command in the build directory:

$ rgrep "x.h" *
CMakeFiles/main.dir/depend.make:CMakeFiles/main.dir/main.cpp.o: /home/poenitz/Desktop/bugreport/src/a/x.h
CMakeFiles/main.dir/CXX.includecache:x.h
CMakeFiles/main.dir/CXX.includecache:/removed/bugreport/src/a/x.h
CMakeFiles/main.dir/CXX.includecache:/removed/bugreport/src/a/x.h
CMakeFiles/main.dir/CXX.includecache:x.h
CMakeFiles/main.dir/CXX.includecache:/removed/bugreport/src/c/x.h
CMakeFiles/main.dir/depend.internal: /removed/bugreport/src/a/x.h
TagsNo tags attached.
Attached Fileszip file icon bugreport.zip [^] (1,530 bytes) 2013-02-20 11:03

 Relationships

  Notes
(0032358)
Rolf Eike Beer (developer)
2013-02-20 12:04

Can you try to #include "./x.h" in both places and see if that helps?

Sadly the C/C++ standards do not say that "" includes should look in the local directory first. This is insane, but sadly the truth. E.g. MSVC compilers handle <> and "" includes exactly the same AFAIK.
(0032359)
tasptz (reporter)
2013-02-20 12:21

No it does not help.
Writing full project paths (a/x.h and c/x.h) resolves the issue.

But isn't it irrelevant?
I think that from a C++ point of view there is no collision here and building it works just fine.

Isn't the only problem that cmake somehow overwrites one dependency because the file names are equal?
(0042229)
Kitware Robot (administrator)
2016-06-10 14:28

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.

 Issue History
Date Modified Username Field Change
2013-02-20 11:03 tasptz New Issue
2013-02-20 11:03 tasptz File Added: bugreport.zip
2013-02-20 12:04 Rolf Eike Beer Note Added: 0032358
2013-02-20 12:21 tasptz Note Added: 0032359
2016-06-10 14:28 Kitware Robot Note Added: 0042229
2016-06-10 14:28 Kitware Robot Status new => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team