CMake: find_package(Foo REQUIRED) with no Foo installed -> "Could not find a package configuration file provided by \"Foo\""
@aiden-f-dsouza▲ -6 net votes
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.