cmake_modules/FindOpenGL.cmake
author Wuzzy <Wuzzy2@mail.ru>
Tue, 27 Aug 2019 23:16:42 +0200
changeset 15370 5a934f83d5eb
parent 11658 f87ed83568c8
permissions -rw-r--r--
Tempoary (!!!) workaround for incorrect key combination description in frontend This workaround fixes the incorrect string while preserving translations and the 1.0.0 string freeze. Remember to revert this commit and fix the string in binds.cpp after the 1.0.0 release!
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11658
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
     1
#.rst:
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
     2
# FindOpenGL
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
     3
# ----------
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
     4
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
     5
# FindModule for OpenGL and GLU.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
     6
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
     7
# Result Variables
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
     8
# ^^^^^^^^^^^^^^^^
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
     9
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    10
# This module sets the following variables:
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    11
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    12
# ``OPENGL_FOUND``
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    13
#  True, if the system has OpenGL.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    14
# ``OPENGL_XMESA_FOUND``
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    15
#  True, if the system has XMESA.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    16
# ``OPENGL_GLU_FOUND``
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    17
#  True, if the system has GLU.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    18
# ``OPENGL_INCLUDE_DIR``
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    19
#  Path to the OpenGL include directory.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    20
# ``OPENGL_LIBRARIES``
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    21
#  Paths to the OpenGL and GLU libraries.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    22
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    23
# If you want to use just GL you can use these values:
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    24
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    25
# ``OPENGL_gl_LIBRARY``
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    26
#  Path to the OpenGL library.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    27
# ``OPENGL_glu_LIBRARY``
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    28
#  Path to the GLU library.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    29
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    30
# OSX Specific
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    31
# ^^^^^^^^^^^^
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    32
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    33
# On OSX default to using the framework version of OpenGL. People will
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    34
# have to change the cache values of OPENGL_glu_LIBRARY and
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    35
# OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    36
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    37
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    38
#=============================================================================
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    39
# Copyright 2001-2009 Kitware, Inc.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    40
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    41
# Distributed under the OSI-approved BSD License (the "License");
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    42
# see accompanying file Copyright.txt for details.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    43
#
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    44
# This software is distributed WITHOUT ANY WARRANTY; without even the
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    45
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    46
# See the License for more information.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    47
#=============================================================================
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    48
# (To distribute this file outside of CMake, substitute the full
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    49
#  License text for the above reference.)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    50
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    51
set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    52
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    53
if (CYGWIN)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    54
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    55
  find_path(OPENGL_INCLUDE_DIR GL/gl.h )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    56
  list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    57
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    58
  find_library(OPENGL_gl_LIBRARY opengl32 )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    59
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    60
  find_library(OPENGL_glu_LIBRARY glu32 )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    61
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    62
elseif (WIN32)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    63
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    64
  if(BORLAND)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    65
    set (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    66
    set (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    67
  else()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    68
    set (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    69
    set (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    70
  endif()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    71
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    72
elseif (APPLE)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    73
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    74
  # The OpenGL.framework provides both gl and glu
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    75
  find_library(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL library for OS X")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    76
  find_library(OPENGL_glu_LIBRARY OpenGL DOC
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    77
    "GLU library for OS X (usually same as OpenGL library)")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    78
  find_path(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OS X")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    79
  list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    80
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    81
else()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    82
  if (CMAKE_SYSTEM_NAME MATCHES "HP-UX")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    83
    # Handle HP-UX cases where we only want to find OpenGL in either hpux64
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    84
    # or hpux32 depending on if we're doing a 64 bit build.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    85
    if(CMAKE_SIZEOF_VOID_P EQUAL 4)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    86
      set(_OPENGL_LIB_PATH
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    87
        /opt/graphics/OpenGL/lib/hpux32/)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    88
    else()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    89
      set(_OPENGL_LIB_PATH
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    90
        /opt/graphics/OpenGL/lib/hpux64/
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    91
        /opt/graphics/OpenGL/lib/pa20_64)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    92
    endif()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    93
  elseif(CMAKE_SYSTEM_NAME STREQUAL Haiku)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    94
    set(_OPENGL_LIB_PATH
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    95
      /boot/develop/lib/x86)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    96
    set(_OPENGL_INCLUDE_PATH
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    97
      /boot/develop/headers/os/opengl)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    98
  endif()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
    99
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   100
  # The first line below is to make sure that the proper headers
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   101
  # are used on a Linux machine with the NVidia drivers installed.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   102
  # They replace Mesa with NVidia's own library but normally do not
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   103
  # install headers and that causes the linking to
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   104
  # fail since the compiler finds the Mesa headers but NVidia's library.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   105
  # Make sure the NVIDIA directory comes BEFORE the others.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   106
  #  - Atanas Georgiev <atanas@cs.columbia.edu>
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   107
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   108
  find_path(OPENGL_INCLUDE_DIR GL/gl.h
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   109
    /usr/share/doc/NVIDIA_GLX-1.0/include
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   110
    /usr/openwin/share/include
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   111
    /opt/graphics/OpenGL/include /usr/X11R6/include
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   112
    ${_OPENGL_INCLUDE_PATH}
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   113
  )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   114
  list(APPEND _OpenGL_REQUIRED_VARS OPENGL_INCLUDE_DIR)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   115
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   116
  find_path(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   117
    /usr/share/doc/NVIDIA_GLX-1.0/include
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   118
    /usr/openwin/share/include
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   119
    /opt/graphics/OpenGL/include /usr/X11R6/include
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   120
  )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   121
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   122
  find_library(OPENGL_gl_LIBRARY
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   123
    NAMES GL MesaGL
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   124
    PATHS /opt/graphics/OpenGL/lib
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   125
          /usr/openwin/lib
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   126
          /usr/shlib /usr/X11R6/lib
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   127
          ${_OPENGL_LIB_PATH}
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   128
  )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   129
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   130
  unset(_OPENGL_INCLUDE_PATH)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   131
  unset(_OPENGL_LIB_PATH)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   132
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   133
  find_library(OPENGL_glu_LIBRARY
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   134
    NAMES GLU MesaGLU
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   135
    PATHS ${OPENGL_gl_LIBRARY}
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   136
          /opt/graphics/OpenGL/lib
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   137
          /usr/openwin/lib
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   138
          /usr/shlib /usr/X11R6/lib
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   139
  )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   140
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   141
endif ()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   142
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   143
if(OPENGL_gl_LIBRARY)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   144
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   145
    if(OPENGL_xmesa_INCLUDE_DIR)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   146
      set( OPENGL_XMESA_FOUND "YES" )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   147
    else()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   148
      set( OPENGL_XMESA_FOUND "NO" )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   149
    endif()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   150
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   151
    set( OPENGL_LIBRARIES  ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES})
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   152
    if(OPENGL_glu_LIBRARY)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   153
      set( OPENGL_GLU_FOUND "YES" )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   154
      if(NOT "${OPENGL_glu_LIBRARY}" STREQUAL "${OPENGL_gl_LIBRARY}")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   155
        set( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   156
      endif()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   157
    else()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   158
      set( OPENGL_GLU_FOUND "NO" )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   159
    endif()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   160
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   161
    # This deprecated setting is for backward compatibility with CMake1.4
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   162
    set (OPENGL_LIBRARY ${OPENGL_LIBRARIES})
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   163
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   164
endif()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   165
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   166
# This deprecated setting is for backward compatibility with CMake1.4
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   167
set(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR})
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   168
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   169
if(BUILD_ENGINE_JS)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   170
    # The implementation is based on the standard FindOpenGL.cmake provided
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   171
    # with CMake, but customized for targeting Emscripten only.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   172
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   173
    # These libraries are provided with Emscripten
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   174
    SET(OPENGL_FOUND TRUE)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   175
    SET(OPENGL_GLU_FOUND TRUE)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   176
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   177
    # Doesn't look like this one is part of Emscripten
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   178
    SET(OPENGL_XMESA_FOUND FALSE)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   179
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   180
    # This is the path where <GL/gl.h> is found
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   181
    SET(OPENGL_INCLUDE_DIR "${EMSCRIPTEN_ROOT_PATH}/system/include")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   182
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   183
    # No library to link against for OpenGL, since Emscripten picks it up
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   184
    # automatically from library_gl.js, but need to report something, or
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   185
    # CMake thinks we failed in the search.
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   186
    SET(OPENGL_LIBRARIES "opengl_emscripten_internal")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   187
    SET(OPENGL_gl_LIBRARY "gl_emscripten_internal")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   188
    SET(OPENGL_glu_LIBRARY "glu_emscripten_internal")
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   189
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   190
    mark_as_advanced(
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   191
      OPENGL_INCLUDE_DIR
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   192
      OPENGL_glu_LIBRARY
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   193
      OPENGL_gl_LIBRARY
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   194
    )
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   195
endif()
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   196
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   197
# handle the QUIETLY and REQUIRED arguments and set OPENGL_FOUND to TRUE if
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   198
# all listed variables are TRUE
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   199
INCLUDE(FindPackageHandleStandardArgs)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   200
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   201
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL REQUIRED_VARS ${_OpenGL_REQUIRED_VARS})
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   202
unset(_OpenGL_REQUIRED_VARS)
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   203
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   204
mark_as_advanced(
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   205
  OPENGL_INCLUDE_DIR
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   206
  OPENGL_xmesa_INCLUDE_DIR
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   207
  OPENGL_glu_LIBRARY
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   208
  OPENGL_gl_LIBRARY
f87ed83568c8 Import the Emscripted toolchain configuration
koda
parents:
diff changeset
   209
)