I downloaded and extracted the latest Gettext archive to a folder ${gettext_PATH_TO_BIN_FOLDER}.
Additionally I have MSYS2 with gettext installed in C:\msys64\mingw64\bin. That path is part of my PATH environmental variable.
I cannot find Gettext via find_package(Gettext PATHS ${gettext_PATH_TO_BIN_FOLDER}), nor via find_package(Gettext PATHS "C:/msys64/mingw64/bin")!
If I only search for find_package(Gettext), the version in “C:/msys64/mingw64/bin” is found.
If I set(CMAKE_PREFIX_PATH ${gettext_PATH_TO_BIN_FOLDER}), and still only use find_package(Gettext), the version in ${gettext_PATH_TO_BIN_FOLDER})` is found.
This means, as soon as I add the PATHS option to the find_package function, CMake will definitively not find Gettext.
Am I wrong to assume this is a bug?
Here is a small sample project showing the problem: cmake-find-gettext.zip (880 Bytes)