[CMake] Re: Finding libraries under Windows

Leon Moctezuma densedev at gmail.com
Wed May 16 23:57:16 EDT 2007


Thanks Brandon and Mike

I did something similar to Mike's code adn this wiki
page[1<http://www.cmake.org/Wiki/CMake_HowToFindInstalledSoftware>
].
I could see different things in Chiken, that helped me to understand cmake
better.

Here is the script:

IIF(WIN32)
    FIND_PATH(FREEGLUT_INCLUDE_DIR GL/freeglut.h ${CMAKE_INCLUDE_PATH}
$ENV{include} ${OPENGL_INCLUDE_DIR})
    FIND_LIBRARY(FREEGLUT_LIBRARY NAMES freeglut_static PATH
${CMAKE_LIBRARY_PATH} $ENV{lib})
ELSE(WIN32)
    FIND_PATH(FREEGLUT_INCLUDE_DIR GL/freeglut.h /usr/include
/usr/local/include)
    FIND_LIBRARY( FREEGLUT_LIBRARY NAMES freeglut glut
              /usr/lib
              /usr/local/lib
        )
ENDIF(WIN32)

IF (FREEGLUT_INCLUDE_DIR AND FREEGLUT_LIBRARY)
   SET(FREEGLUT_FOUND TRUE)
ENDIF (FREEGLUT_INCLUDE_DIR AND FREEGLUT_LIBRARY)

IF(NOT FREEGLUT_FOUND)
   IF (FREEGLUT_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find FREEGLUT")
   ENDIF (FREEGLUT_FIND_REQUIRED)
ENDIF(NOT FREEGLUT_FOUND)

If you have a better solution, please don't hesitate to post it.

Best Regards.

Leon Moctezuma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070516/0f350b43/attachment.html


More information about the CMake mailing list