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

R. Keith Morley kmorley at nvidia.com
Mon Jun 9 16:31:48 EDT 2014


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.



TLDR --

find_package( GLEW REQUIRED
      #PATHS /software/glew/1.5.5/linux.centos5.x86_64/gcc4.1.2/
      )

Works fine:
-- Found GLEW: /usr/include

When I uncomment PATHS (or use HINTS in same way) I get the above error.


Any advice is appreciated.

keith


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------


More information about the CMake mailing list