what could be wrong with linking here?
basically why is fileB.cpp
not able to include fileA.hpp
despite linking dir-B
with dir-A
?
> dirA
> include
> fileA.hpp
> src
> fileA.cpp
add_library(dir-A STATIC src/fileA.cpp)
target_include_directories(dir-A PUBLIC include)
target_link_libraries(dir-A #<some-external-libs>)
set(THIS dir-B)
target_link_libraries(${THIS} PUBLIC dir-A) # Link dir-A as a dependency of dir-B
set(THIS dir-C)
add_executable(${THIS} fileB.cpp fileC.cpp)
target_link_libraries(${THIS} PRIVATE dir-B) # Link dir-B as a dependency of dir-C
// fileC.cpp
#include "fileB.hpp"
// fileB.hpp
#include "fileA.hpp" // fatal error: fileA.hpp: No such file or directory```