FindGLEW¶
Finds the OpenGL Extension Wrangler Library (GLEW):
find_package(GLEW [<version>] [...])
GLEW is a cross-platform C/C++ library that helps manage OpenGL extensions by providing efficient run-time mechanisms to query and load OpenGL functionality beyond the core specification.
Добавлено в версии 3.7: Debug and Release library variants are found separately.
Добавлено в версии 3.15: If GLEW is built using its CMake-based build system, it provides a CMake
package configuration file (GLEWConfig.cmake). This module now takes that
into account and first attempts to find GLEW in config mode. If the
configuration file is not available, it falls back to module mode and
searches standard locations.
Imported Targets¶
This module provides the following Imported Targets:
GLEW::GLEWДобавлено в версии 3.1.
The main imported target encapsulating the GLEW usage requirements, available if GLEW is found. It maps usage requirements of either
GLEW::gleworGLEW::glew_starget depending on their availability.GLEW::glewДобавлено в версии 3.15.
Target encapsulating the usage requirements for a shared GLEW library. This target is available if GLEW is found and static libraries aren't requested via the
GLEW_USE_STATIC_LIBShint variable (see below).GLEW::glew_sДобавлено в версии 3.15.
Target encapsulating the usage requirements for a static GLEW library. This target is available if GLEW is found and the
GLEW_USE_STATIC_LIBShint variable is set to boolean true.
Result Variables¶
This module defines the following variables:
GLEW_FOUNDBoolean indicating whether (the requested version of) GLEW was found.
GLEW_VERSIONДобавлено в версии 3.15.
The version of GLEW found.
GLEW_VERSION_MAJORДобавлено в версии 3.15.
The major version of GLEW found.
GLEW_VERSION_MINORДобавлено в версии 3.15.
The minor version of GLEW found.
GLEW_VERSION_MICROДобавлено в версии 3.15.
The micro version of GLEW found.
GLEW_INCLUDE_DIRSInclude directories needed to use GLEW library.
GLEW_LIBRARIESLibraries needed to link against to use GLEW library (shared or static depending on configuration).
GLEW_SHARED_LIBRARIESДобавлено в версии 3.15.
Libraries needed to link against to use shared GLEW library.
GLEW_STATIC_LIBRARIESДобавлено в версии 3.15.
Libraries needed to link against to use static GLEW library.
Hints¶
This module accepts the following variables before calling
find_package(GLEW) to influence this module's behavior:
GLEW_USE_STATIC_LIBSДобавлено в версии 3.15.
Set to boolean true to find static GLEW library and create the
GLEW::glew_simported target for static linkage.GLEW_VERBOSEДобавлено в версии 3.15.
Set to boolean true to output a detailed log of this module. Can be used, for example, for debugging.
Examples¶
Finding GLEW and linking it to a project target:
find_package(GLEW)
target_link_libraries(project_target PRIVATE GLEW::GLEW)
Using the static GLEW library, if found:
set(GLEW_USE_STATIC_LIBS TRUE)
find_package(GLEW)
target_link_libraries(project_target PRIVATE GLEW::GLEW)