<div dir="ltr">Hello, I'm a CMake newbie trying to build a chain of libraries on windows, let's call them A, B and C<div><br></div><div>A is a standalone shared library</div><div>B is a shared library that depends on A in its headers & implementation</div><div>C is a shared library that depends on B (and so implicitly depends on A)</div><div><br></div><div>All three export themselves as cmake packages - config generation is essentially a copy & paste job from</div><div><a href="http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file">http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file</a><br></div><div><br></div><div>Each is built and installed in turn.</div><div><br></div><div>B uses find_package(A) - The installed location of A's .cmake files is provided during configuration by setting the A_DIR var.</div><div>C is built similarly via find_package(B) and providing the location of the installed .cmake files for B.</div><div><br></div><div>B builds fine and finds & links to it's dependency A using the full installed path of A.</div><div>C finds B, and knows it is dependent on A, but the linker is only passed the name of A rather than the full path. No additional library paths get added to the generated project, so the build fails at link time.</div><div><br></div><div>Is it normal behaviour that you need to manually specify the location of all public transitive dependencies somehow, or am I doing something wrong when exporting targets?</div><div><br></div><div>I figured that as B was installed using a known location of A, C should be able to find A from B's installed configs. Looking at the installed <targetname>Targets-<config>.cmake from B, it's own location is specified as a full path (set via IMPORTED_LOCATION_<CONFIG>)<br></div><div><br></div><div>However, only the names of dependent targets are set (via INTERFACE_LINK_LIBRARIES in <targetname>Targets.cmake) </div><div><br></div><div>I guess that's where the problem lies, I'm just not sure how to fix it..</div><div><br></div><div>Rich<br></div><div><br></div></div>