Hi,<div><br></div><div>I'm having trouble understanding how I should solve this case correctly in CMake :</div><div><br></div><div>I want my project A to include+link my project B. I already made it with project C but it don't work with A.</div>
<div>I think the problems comes from the directory structure :</div><div><br></div><div>/myrepo/tools/A (exe/Qt)</div><div>/myrepo/tools/B (shared library) </div><div>/myrepo/tools/B/C (exe)</div><div><br></div><div>Each of those folders have a CMakeFiles.txt file that add_subdirectory( the_sub_directories ).</div>
<div><br></div><div>B uses include_directories() and C use target_link_libraries( C B )</div><div>So C does include and compile+link with code using B code.</div><div><br></div><div>A code runs fine alone, but now I need it to use B.</div>
<div>I've added </div><div><br></div><div>target_link_libraries( A ${QT_LIBRARIES} B )</div><div><br></div><div>to make sure it does uses B but the generated projects don't have the B include directory.</div><div>
<br></div><div>I know that I could use an advanced variable to get the include file, but I don't find it consistent with the fact that</div><div>C executable does implicitely use the include file from B. A being configured the same, it should work too... no?</div>
<div><br></div><div>I think it's related to the projects CMakeFiles.txt positions in the directory hierarchy but I'm still often wrestling with CMake so I'm not sure.</div><div><br></div><div>What would be the idiomatic CMake way of making A include+link B?</div>
<div><br></div><div>The real code is open source so I can show you exactly what is my current setup if it helps (but I guess it's a noob question...)</div><div><br></div><div><br></div><div>Klaim - Joël Lamotte</div>