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
_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to