<div dir="ltr"><div>After some hours of research and getting no help on Stackoverflow, I decided to ask here on the mailing list.</div><div><br></div><div>I have a problem with my CMake build system. There are CMakeLists.txt files defining runtimes or libraries or using ExternalProjects_Add() to download and build external code. Because of dependencies, those projects have to find each other. Now I want to have a CMakeLists.txt at the top level that builds all those at once. In order to find a project, is must be installed. But finding projects is already done at configuration time in CMake.</div><div><br></div><div>Those are two approaches I already tried:</div><div><br></div><div>1. Run a CMake process for every project: Using execute_process(${CMAKE_COMMAND} ...), I can configure and build each project after another at configure time. However, this means I always have to run CMake after editing the code and cannot compile from within the IDE I generated project files for.<br></div><div><br></div><div>2. Linking to CMake targets: Running a CMake process for all external libraries is okay since I don't work on them. My own libraries could be used by calling target_link_libraries() with their target names. However, linking isn't enough. My libraries include directories of external libraries. Those must be made available to the using project, as well.<br></div><div><br></div><div>How can I use libraries within my CMake project that need to be installed first?</div></div>