On Tue, Feb 26, 2008 at 1:28 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Actually, try this: (note the "NAMES")<br>
find_library(glut NAMES "glut32" PATHS "Z:/Opt/lib" NO_DEFAULT_PATH)<br>
<br>
Commands can be upper or lower case, but the arguments to the commands
that are "special" words must typically still be upper case, exactly as
documented with --help-command. So NAMES should be all upper case...</blockquote><div><br>Harsha,<br><br>Writing your own custom FIND_LIBRARY() invocations works, but take note of the existence of CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH which are great variables to use if you're trying to force linking against a library installed in a non-standard place. This way you can reuse existing CMake Find* Modules. For example:<br>
<br><br>SET(CMAKE_LIBRARY_PATH "Z:/Opt/lib")<br>SET(CMAKE_INCLUDE_PATH "Z:/Opt/include")<br>FIND_PACKAGE(GLUT)<br>SET(CMAKE_LIBRARY_PATH) # Clear the contents of the variable for safety<br>SET(CMAKE_INCLUDE_PATH) # Clear the contents of the variable for safety<br>
<br><br><br>If you're using CMake CVS you can append to the CMAKE_PREFIX_PATH variable instead (provided the header files are in "include" and the libraries in "lib" relative to one of the directories specified in the list)<br>
<br>For example, if your libraries were located like so:<br>/Path/To/CustomGlut/lib/libglut.so<br>/Path/To/CustomGlut/include/GL/glut.h<br><br>SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/Path/To/CustomGlut")<br>
FIND_PACKAGE(GLUT)<br><br><br></div></div>-- <br>Philip Lowman