<div dir="ltr">Hi,<div><br></div><div>My project is setup in such a way that I perform a FetchContent 'only if' my find_package fails.</div><div><br></div><div>This works very well until I start building different configurations. Let's say I generate and build Debug for my project. My project tries to find_package(LibA QUIET) and cannot find it. So, it performs a FetchContent(...) step, builds the dependency and my library and installs everything. This works flawlessly.</div><div><br></div><div>Now I start building a Release version with different build and install folders. Unfortunately, find_package(LibA QUIET) finds the Debug libraries and does not perform a FetchContent(...) step and in turn doesn't build the Release version of the dependent library. Consequently, the linking step fails.</div><div><br></div><div>Is there an easy way around this issue? </div><div><br></div><div>I say 'easy' because I could write some CMake scripts to search for the libraries after a successful find_package(...) and if it only finds libraries for Debug when it really wants Release, it performs a FetchContent(...). However, this could be quite fragile.</div><div><br></div><div>It would be nice if CMake has a way of knowing if an installed library, found through find_package(...) is Debug, Release, RelWithDebInfo etc.</div><div><br></div><div>- Saad</div></div>