Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ else()
message(FATAL_ERROR "OpenGL ES 3 support is currently only available for Linux platforms. You're building for ${CMAKE_SYSTEM_NAME}.")
endif()

# We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream.
list(APPEND CMAKE_MODULE_PATH "${PROJECTM_SOURCE_DIR}/cmake/gles")
if (CMAKE_VERSION VERSION_LESS_EQUAL "3.26" OR CMAKE_SYSTEM_NAME STREQUAL Android)
# We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream.
list(APPEND CMAKE_MODULE_PATH "${PROJECTM_SOURCE_DIR}/cmake/gles")
endif()
find_package(OpenGL REQUIRED COMPONENTS GLES3)
if(NOT TARGET OpenGL::GLES3)
message(FATAL_ERROR "No suitable GLES3 library was found.")
Expand Down
6 changes: 3 additions & 3 deletions cmake/gles/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GLES3 Find Script

The OpenGL CMake find script in this directory contains additional code to find GLES versions 1 to 3. It was taken from
CMake 3.22 and patched accordingly. A merge request is underway upstream, so ideally, this will be part of CMake 3.23+.
CMake 3.22 and patched accordingly. A merge request was accepted upstream, it is part of CMake 3.27.

In the meantime, we'll use this script as a local copy if GLES3 support is requested. Will add a version check once it's
in upstream CMake so this file will only be used if the CMake version used to build projectM is too low.
We use this script for CMake lower than 3.27 as a local copy if GLES3 support is requested to provide compatibility. A version check
compares the current CMake version so this file will only be used if the CMake version used to build projectM is too low.
10 changes: 8 additions & 2 deletions src/libprojectM/projectM4Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ include(CMakeFindDependencyMacro)

if(NOT "@ENABLE_EMSCRIPTEN@") # ENABLE_EMSCRIPTEN
if("@ENABLE_GLES@") # ENABLE_GLES
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
find_dependency(OpenGL COMPONENTS GLES3)
if (CMAKE_VERSION VERSION_LESS_EQUAL "3.26" OR CMAKE_SYSTEM_NAME STREQUAL Android)
set(PROJECTM4_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
find_dependency(OpenGL COMPONENTS GLES3)
set(CMAKE_MODULE_PATH ${PROJECTM4_PREV_MODULE_PATH})
else()
find_dependency(OpenGL COMPONENTS GLES3)
endif()
else()
find_dependency(OpenGL)
endif()
Expand Down
Loading