# Will find\_package try multiple FindXxx.cmake modules after one returns Xxx\_Found=FALSE?

**URL:** https://discourse.cmake.org/t/will-find-package-try-multiple-findxxx-cmake-modules-after-one-returns-xxx-found-false/15849
**Category:** Code
**Created:** [September 22, 2026, 4:01pm UTC](https://discourse.cmake.org/t/will-find-package-try-multiple-findxxx-cmake-modules-after-one-returns-xxx-found-false/15849 "2026-09-22T16:01:32Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dbear496](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@dbear496](https://discourse.cmake.org/u/dbear496)
#### Post date: [September 22, 2026, 4:01pm UTC](https://discourse.cmake.org/t/will-find-package-try-multiple-findxxx-cmake-modules-after-one-returns-xxx-found-false/15849/1 "2026-09-22T16:01:32Z")

</div>

I’m in a situation where my project could have multiple directories in `CMAKE_MODULE_PATH`, and in those directories, there could be multiple `Find<package>.cmake` files for the same package. When `find_package(<package>)` searches in module mode and finds a module that sets `<package>_FOUND` to `FALSE`, will it continue searching additional module paths for a different find module that might actually find the package? If not, it seems like this would be a nice feature to have for situations where two find modules search in different places for a package.

To give context to my specific situation, I’m trying to architect my CMake files such that `find_package` can fall back to calling `FetchContent_MakeAvailable` if the package is not otherwise found on the system. `OVERRIDE_FIND_PACKAGE` does not do what I want because it prevents `find_package` from looking on the system first. `FIND_PACKAGE_ARGS` does not do what I want because it requires all `find_package` calls in my project to be converted to `FetchContent_MakeAvailable`, and that would break when there is no `FetchContent_Declare`.

So my idea is to have a `FetchContent_Declare` for each package that I want a FetchContent fallback for, and then make a `Find<package>.cmake` file that calls `FetchContent_MakeAvailable` and sets up any needed alias targets. But some of my dependencies already have a normal `Find<package>.cmake` file that looks for the package with system inspection, and I want my fallback `Find<package>.cmake` to be called only if the normal one fails. If the user doesn’t want the fallback feature, then they can set a cache variable so that `FetchContent_Declare` will not be called and the location of the fallback `Find<package>.cmake` files will not be added to `CMAKE_MODULE_PATH`. I’m just concerned that if the normal `Find<package>.cmake` returns `<package>_FOUND=FALSE`, then `find_package` might take that as authoritative and not attempt my fallback `Find<package>.cmake` file.

---

<div class="post-metadata">

### Author: ![dbear496](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@dbear496](https://discourse.cmake.org/u/dbear496)
#### Post date: [September 24, 2026, 1:04am UTC](https://discourse.cmake.org/t/will-find-package-try-multiple-findxxx-cmake-modules-after-one-returns-xxx-found-false/15849/2 "2026-09-24T01:04:01Z")

</div>

I was able to solve my issue by injecting a dependency provider that first calls find\_package without REQUIRED and, if that failed, then it calls FetchContent\_MakeAvailable.
