What “rules” does cmake follow when locating a find-module? This document says " In Module mode, the command searches for a find module: a file named Find<Package>.cmake."
For example:
find_package(PROJ MODULE_ONLY)
I.e. the package is “PROJ” (not “Proj”). I have a find-module named “FindProj.cmake”. I do NOT have a find-module called “FindPROJ.cmake”.
cmake 3.22.1 seems to look only for FindPROJ.cmake, and cannot find it, printing this message:
CMake Warning at CMakeLists.txt:33 (find_package):
By not providing "FindPROJ.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "PROJ", but
CMake did not find one.
But cmake 3.25 finds and runs “FindProj.cmake” - it seems this version of cmake doesn’t care about case of the find-module’s <Package> component. Can someone point to a document that clearly specifies how cmake locates a find-module for a specified package?
Thanks!
Is this on macOS? The filesystem is case-insensitive (by default and convention), so find_package(PROJ) will pick up FindProj.cmake, but the package “name” will be what was requested.
I see the different behavior on two ubuntu systems running different cmake versions, not MacOS. But that’s an interesting point @ben.boeckel - and a bit annoying that cmake’s search algorithm would behave in a subtle but significant way depending on OS.
Debian 12 also has CMake 3.25.1 installed, and I cannot confirm such problem.
Please check on which filesystem you are running. FAT or VM shared folders might also be case-insensitive, regardless of the OS.