FindGLUT

Finds the OpenGL Utility Toolkit (GLUT) library, which provides a simple API for creating windows, handling input, and managing events in OpenGL applications.

Imported Targets

This module provides the following Imported Targets:

GLUT::GLUT

Added in version 3.1.

Target encapsulating the GLUT usage requirements, available if GLUT is found.

Result Variables

This module defines the following variables:

GLUT_FOUND

Boolean indicating whether GLUT is found.

GLUT_INCLUDE_DIRS

Added in version 3.23.

Include directories needed to use GLUT. Starting with CMake 3.23, this variable is intended to be used in target usage requirements instead of the cache variable GLUT_INCLUDE_DIR, which is intended for finding GLUT.

GLUT_LIBRARIES

List of libraries needed to link against for using GLUT.

Cache Variables

This module may set the following cache variables depending on platform. These variables may optionally be set to help this module find the correct files, but should not be used as result variables:

GLUT_INCLUDE_DIR

The full path to the directory containing GL/glut.h (without the GL/).

GLUT_glut_LIBRARY

The full path to the glut library.

GLUT_Xi_LIBRARY

The full path to the dependent Xi (X Input Device Extension) library on some systems.

GLUT_Xmu_LIBRARY

The full path to the dependent Xmu (X Miscellaneous Utilities) library on some systems.

Examples

Finding GLUT and linking it to a project target:

find_package(GLUT)
target_link_libraries(project_target PRIVATE GLUT::GLUT)