<div dir="ltr">Here&#39;s the problem I&#39;m trying to solve:<div><br></div><div style>* External Project A has no dependencies and generates LibraryA</div><div style>* External Project B is dependent on LibraryA</div><div style>
<br></div><div style>Root CMakeLists.txt:</div><div style>add_subdirectory(external_project_a)</div><div style>add_subdirectory(external_project_b)</div><div style><br></div><div style>External Project A CMakeLists.txt:</div>
<div style>ExternalProject_Add(projectA ...)</div><div style><br></div><div style>External Project B CMakeLists.txt:</div><div style>find_package(LibraryA)</div><div style>ExternalProject_Add(projectB ...)</div><div style>
<br></div><div style><br></div><div style>When I configure CMake, it finds an old, locally installed version of LibraryA. When cross-compiling, I want External Project B&#39;s find_package(LibraryA) to find the newly cross-compiled LibraryA. </div>
<div style><br></div><div style>It feels like I need to somehow &quot;run find_package again&quot; at that point so it finds the right one. Right now I can manually make it work by building/installing External Project A then manually clearing my build folder and re-running CMake.</div>
<div style><br></div><div style>How do I get External Project B to see the new cross-compiled LibraryA?</div><div style><br></div><div style>Thanks</div><div style><br></div></div>