[CMake] Confusion regarding usage of find_package and PATHS or HINTS

Nils Gladitz nilsgladitz at gmail.com
Mon Jun 9 16:58:40 EDT 2014


On 09.06.2014 22:31, R. Keith Morley wrote:
> Hello,
>
> I am having trouble using find_package along with PATHS or HINTS. If I
> include a PATHS or HINTS path which does not contain the searched-for
> package, I always get an error such as this:
>
> CMake Error at CMakeLists.txt:182 (find_package):
>    Could not find module FindGLEW.cmake or a configuration file for 
> package
>    GLEW.
>
>    Adjust CMAKE_MODULE_PATH to find FindGLEW.cmake or set GLEW_DIR to the
>    directory containing a CMake configuration file for GLEW.  The file 
> will
>    have one of the following names:
>
>      GLEWConfig.cmake
>      glew-config.cmake
>
>
> If I leave off the HINTS or PATHS modifier, everything works fine and
> the packages, which is located in a standard system dir, is found.  I
> have noticed this with FindGLEW and with FindBoost in cmake versions
> 2.8.11.2 and with 2.8.7.
>

HINTS and PATHS are part of the "Config" mode signature of find_package().
FindGLEW.cmake and FindBoost.cmake are only used in "Module" mode.

Nils


More information about the CMake mailing list