Hi!

In the attachment module for FreeGLUT library. Hope this will be usefull.
Tested on Debian squeeze with freeglut3-dev package.
Module was originally made from GLUT-module.

--
С уважением,
Янчарук Александр
<mailto:alex.yancha...@yandex.ru>

# - try to find freeglut library and include files
#  FREEGLUT_INCLUDE_DIR, where to find GL/freeglut.h, etc.
#  FREEGLUT_LIBRARIES, the libraries to link against
#  FREEGLUT_FOUND, If false, do not try to use FreeGLUT.
# Also defined, but not for general use are:
#  FREEGLUT_freeglut_LIBRARY = the full path to the glut library.
#  FREEGLUT_Xmu_LIBRARY  = the full path to the Xmu library.
#  FREEGLUT_Xi_LIBRARY   = the full path to the Xi Library.

#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
#  License text for the above reference.)

if (WIN32)
  find_path( FREEGLUT_INCLUDE_DIR NAMES GL/freeglut.h
    PATHS  ${FREEGLUT_ROOT_PATH}/include )
  find_library( FREEGLUT_freeglut_LIBRARY NAMES freeglut
    PATHS
    ${OPENGL_LIBRARY_DIR}
    ${GLUT_ROOT_PATH}/Release
    )
else ()

  if (APPLE)
    # These values for Apple could probably do with improvement.
    find_path( FREEGLUT_INCLUDE_DIR freeglut.h
      /System/Library/Frameworks/GLUT.framework/Versions/A/Headers
      ${OPENGL_LIBRARY_DIR}
      )
    set(FREEGLUT_freeglut_LIBRARY "-framework FreeGLUT" CACHE STRING "FreeGLUT library for OSX")
    set(FREEGLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
  else ()

    find_path( FREEGLUT_INCLUDE_DIR GL/freeglut.h
      /usr/include/GL
      /usr/openwin/share/include
      /usr/openwin/include
      /opt/graphics/OpenGL/include
      /opt/graphics/OpenGL/contrib/libglut
      )

    find_library( FREEGLUT_freeglut_LIBRARY glut freeglut
      /usr/openwin/lib
      )

    find_library( FREEGLUT_Xi_LIBRARY Xi
      /usr/openwin/lib
      )

    find_library( FREEGLUT_Xmu_LIBRARY Xmu
      /usr/openwin/lib
      )

  endif ()

endif ()

include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FREEGLUT REQUIRED_VARS FREEGLUT_freeglut_LIBRARY FREEGLUT_INCLUDE_DIR)

if (FREEGLUT_FOUND)
  # Is -lXi and -lXmu required on all platforms that have it?
  # If not, we need some way to figure out what platform we are on.
  set( FREEGLUT_LIBRARIES
    ${FREEGLUT_freeglut_LIBRARY}
    ${FREEGLUT_Xmu_LIBRARY}
    ${FREEGLUT_Xi_LIBRARY}
    ${FREEGLUT_cocoa_LIBRARY}
    )
  #The following is for FREEGLUT definition usage in source
  set (FREEGLUT_DEFINITIONS -DFREEGLUT="YES")

  #The following deprecated settings are for backwards compatibility with CMake1.4
  set (FREEGLUT_LIBRARY ${FREEGLUT_LIBRARIES})
  set (FREEGLUT_INCLUDE_PATH ${FREEGLUT_INCLUDE_DIR})
endif()

mark_as_advanced(
  FREEGLUT_INCLUDE_DIR
  FREEGLUT_glut_LIBRARY
  FREEGLUT_Xmu_LIBRARY
  FREEGLUT_Xi_LIBRARY
  )
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to