How to find headers in dependency package with Conan?

Viewed 35

I have a very simple project in Conan, packageA, that depends on another Conan package, packageB. packageA needs to be able to find headers in packageB, but as shown, does not.

Building CXX object src/test/CMakeFiles/test.dir/main.cpp.o
/home/me/test/src/test/main.cpp:2:10: fatal error: MyTest.h: No such file or directory
    2 | #include "MyTest.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

MyTest.h is located in packageB which builds fine and I export it to the local cache. The error above is when I compile packageA. Neither of the packages have *.cmake files. My understanding is that if they build and are in the cache, this is enough to find the dependency headers.

I'm assuming I have to add something to conanfile.py which will allow for packageA to find them in packageB via CMake?

0 Answers
Related