With libepoxy we can choose between EGL and GLX at runtime, as well as dynamically open EGL and GLX libraries without linking to them. This will make it possible to build with Wayland, EGL, GLVND support while still running on systems that only have X11, GLX and libGL. It also paves the way for headless rendering through EGL. libepoxy is a new library dependency, and is included in the precompiled libraries. GLEW is no longer a dependency, and WITH_SYSTEM_GLEW was removed. Includes contributions by Brecht Van Lommel, Ray Molenkamp, Campbell Barton and Sergey Sharybin. Ref T76428 Differential Revision: https://developer.blender.org/D15291
48 lines
1.1 KiB
CMake
48 lines
1.1 KiB
CMake
# SPDX-License-Identifier: BSD-3-Clause
|
|
# Copyright 2022 Blender Foundation.
|
|
|
|
# This module defines
|
|
# Epoxy_INCLUDE_DIRS, where to find epoxy/gl.h
|
|
# Epoxy_LIBRARY, where to find the epoxy library.
|
|
# Epoxy_ROOT_DIR, The base directory to search for epoxy.
|
|
# This can also be an environment variable.
|
|
# Epoxy_FOUND, If false, do not try to use epoxy.
|
|
|
|
IF(NOT EPOXY_ROOT_DIR AND NOT $ENV{EPOXY_ROOT_DIR} STREQUAL "")
|
|
SET(EPOXY_ROOT_DIR $ENV{EPOXY_ROOT_DIR})
|
|
ENDIF()
|
|
|
|
FIND_PATH(Epoxy_INCLUDE_DIR
|
|
NAMES
|
|
epoxy/gl.h
|
|
HINTS
|
|
${EPOXY_ROOT_DIR}
|
|
PATH_SUFFIXES
|
|
include
|
|
)
|
|
|
|
FIND_LIBRARY(Epoxy_LIBRARY
|
|
NAMES
|
|
epoxy
|
|
HINTS
|
|
${EPOXY_ROOT_DIR}
|
|
PATH_SUFFIXES
|
|
lib64 lib
|
|
)
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set Epoxy_FOUND to TRUE if
|
|
# all listed variables are TRUE
|
|
INCLUDE(FindPackageHandleStandardArgs)
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Epoxy DEFAULT_MSG
|
|
Epoxy_LIBRARY Epoxy_INCLUDE_DIR)
|
|
|
|
IF(Epoxy_FOUND)
|
|
SET(Epoxy_INCLUDE_DIRS ${Epoxy_INCLUDE_DIR})
|
|
SET(Epoxy_LIBRARIES ${Epoxy_LIBRARY})
|
|
ENDIF()
|
|
|
|
MARK_AS_ADVANCED(
|
|
Epoxy_INCLUDE_DIR
|
|
Epoxy_LIBRARY
|
|
)
|