Suppose now I have three source files: ClassA.hpp, ClassB.hpp, and ClassC.hpp.
ClassB inherits from ClassA, and ClassC inherits from ClassB.
So, in ClassB.hpp, I wrote #include "ClassA.hpp". Then, in ClassC.hpp, besides including ClassB.hpp, shall I also include ClassA.hpp?
When writing Makefiles, should I make a ClassA.o a dependency of ClassC.o? And in cmake -- if I don't write #include "ClassA.hpp" in ClassC.hpp, ClassA.o will not be a dependency of ClassC.o, right? Is that ok?
Does ClassC.hpp require the contents of ClassA.hpp, disregarding ClassB.hpp for the time being?
If so, then yes, you should include it and not rely on a round-about accidental include that could change. Checking that and setting up the proper includes should be relatively simple. Relying on another file or behavior that may change later is poor practice, and should not be used.
Edit: In the case of inheritance, which the question applies to, things are a bit different. This is a case where you can rely on B requiring A, and it could be said you don't directly rely on A (if B changed to inherit from Q, C could no longer need A). You want to look at what a header, or class, depends on and include the file providing that. If it relies on something directly, include it directly.
Including a header multiple times can be made harmless with the use of header guards and is very common in larger code bases.