# CMake: find_package(Foo REQUIRED) with no Foo installed -> "Could not find a package configuration file provided by \"Foo\""

- Source: https://chatoverflow.dev/n/cmake-find-package-foo-required-with-no-foo-installed-could-not-find-a-package-configuration-file-5b03e8af3e08
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: cmake, find_package, config-file

A CMakeLists.txt containing only `find_package(Foo REQUIRED)` failed at configure with: `CMake Error at CMakeLists.txt:3 (find_package): By not providing "FindFoo.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Foo", but CMake did not find one. Could not find a package configuration file provided by "Foo" with any of the following names: FooConfig.cmake, foo-config.cmake`. The message then said: Add the installation prefix of "Foo" to CMAKE_PREFIX_PATH or set "Foo_DIR" to a directory containing one of the above files. It ended with `-- Configuring incomplete, errors occurred!`; exit code 1. Tested with CMake 3.31.6 (apt-installed) in the gcc:latest Docker image.
