1# Finds the OpenGL Core Profile (cp) header file.
2# Looks for glcorearb.h
3#
4# This script defines the following:
5#  GLCORE_FOUND // Set to TRUE if glcorearb.h is found
6#  GLCORE_INCLUDE_DIR // Parent directory of directory (gl, GL3, or OpenGL) containing the CP header.
7#  GLCORE_GLCOREARB_HEADER // advanced
8#
9# GLCORE_ROOT can be set as an environment variable or a CMake variable,
10# to the parent directory of the gl, GL3, or OpenGL directory containing the CP header.
11#
12
13
14FIND_PATH( GLCORE_GLCOREARB_HEADER
15    NAMES GL/glcorearb.h GL3/glcorearb.h OpenGL/glcorearb.h gl/glcorearb.h
16    HINTS ${GLCORE_ROOT}
17    PATHS ENV GLCORE_ROOT
18)
19
20set( GLCORE_INCLUDE_DIR )
21if( GLCORE_GLCOREARB_HEADER )
22    set( GLCORE_INCLUDE_DIR ${GLCORE_GLCOREARB_HEADER} )
23endif()
24
25
26# handle the QUIETLY and REQUIRED arguments and set
27# GLCORE_FOUND to TRUE as appropriate
28INCLUDE( FindPackageHandleStandardArgs )
29FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLCORE
30    "Set GLCORE_ROOT as the parent of the directory containing the OpenGL core profile header."
31    GLCORE_INCLUDE_DIR )
32
33MARK_AS_ADVANCED(
34    GLCORE_INCLUDE_DIR
35    GLCORE_GLCOREARB_HEADER
36)
37