CMake misses a dependency of a C++ file on one of included header files with the same name
Hello,
I have a problem where a target did not recompile after one of the indirectly included header files has been changed. While exploring the problem, I found out that it manifests only if the given source file included two header files with the same name, but from different directories.
Please assume the following structure of a minimal project that reproduces the problem:
main.cpp:
#include "dir_a/header1.h"
#include "dir_b/header2.h"
dir_a/header1.h:
#include "other_header.h"
dir_a/other_header.h:
// Nothing
dir_b/header2.h:
#include "other_header.h"
dir_b/other_header.h:
// Nothing
Now, if main.cpp is used as a source file in some cmake target, the corresponding object file will have dependencies on "dir_a/header1.h", "dir_a/other_header.h" and "dir_b/header2.h". The problem is that there's no dependency on "dir_b/other_header.h" in depend.make file.