ecd26f9f5b
Currently this submission is Windows-only. I don't think OSX or Linux require any help in locating gl/glcorearb.h. But if they do, this submission can be easily modified. Files: - "CMakeLists.txt" is the top-level file. - FindGLCORE.cmake" and "OsgMacroUtils.cmake" go in CMakeModules. "
37 lines
1.1 KiB
CMake
37 lines
1.1 KiB
CMake
# Finds the OpenGL Core Profile (cp) header file.
|
|
# Looks for glcorearb.h
|
|
#
|
|
# This script defines the following:
|
|
# GLCORE_FOUND // Set to TRUE if glcorearb.h is found
|
|
# GLCORE_INCLUDE_DIR // Parent directory of directory (gl, GL3, or OpenGL) containing the CP header.
|
|
# GLCORE_GLCOREARB_HEADER // advanced
|
|
#
|
|
# GLCORE_ROOT can be set as an environment variable or a CMake variable,
|
|
# to the parent directory of the gl, GL3, or OpenGL directory containing the CP header.
|
|
#
|
|
|
|
|
|
FIND_PATH( GLCORE_GLCOREARB_HEADER
|
|
NAMES GL/glcorearb.h GL3/glcorearb.h OpenGL/glcorearb.h gl/glcorearb.h
|
|
HINTS ${GLCORE_ROOT}
|
|
PATHS ENV GLCORE_ROOT
|
|
)
|
|
|
|
set( GLCORE_INCLUDE_DIR )
|
|
if( GLCORE_GLCOREARB_HEADER )
|
|
set( GLCORE_INCLUDE_DIR ${GLCORE_GLCOREARB_HEADER} )
|
|
endif()
|
|
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set
|
|
# GLCORE_FOUND to TRUE as appropriate
|
|
INCLUDE( FindPackageHandleStandardArgs )
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLCORE
|
|
"Set GLCORE_ROOT as the parent of the directory containing the OpenGL core profile header."
|
|
GLCORE_INCLUDE_DIR )
|
|
|
|
MARK_AS_ADVANCED(
|
|
GLCORE_INCLUDE_DIR
|
|
GLCORE_GLCOREARB_HEADER
|
|
)
|