Skip to content

Commit 09941b5

Browse files
committed
use cmake built-in FindOpenGL module for GLES with cmake 3.23+
1 parent ebb8b33 commit 09941b5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,10 @@ else()
169169
message(FATAL_ERROR "OpenGL ES 3 support is currently only available for Linux platforms. You're building for ${CMAKE_SYSTEM_NAME}.")
170170
endif()
171171

172-
# We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream.
173-
list(APPEND CMAKE_MODULE_PATH "${PROJECTM_SOURCE_DIR}/cmake/gles")
172+
if (CMAKE_VERSION VERSION_LESS_EQUAL "3.22" OR CMAKE_SYSTEM_NAME STREQUAL Android)
173+
# We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream.
174+
list(APPEND CMAKE_MODULE_PATH "${PROJECTM_SOURCE_DIR}/cmake/gles")
175+
endif()
174176
find_package(OpenGL REQUIRED COMPONENTS GLES3)
175177
if(NOT TARGET OpenGL::GLES3)
176178
message(FATAL_ERROR "No suitable GLES3 library was found.")

src/libprojectM/projectM4Config.cmake.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ include(CMakeFindDependencyMacro)
66

77
if(NOT "@ENABLE_EMSCRIPTEN@") # ENABLE_EMSCRIPTEN
88
if("@ENABLE_GLES@") # ENABLE_GLES
9-
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
9+
if (CMAKE_VERSION VERSION_LESS_EQUAL "3.22" OR CMAKE_SYSTEM_NAME STREQUAL Android)
10+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
11+
endif()
1012
find_dependency(OpenGL COMPONENTS GLES3)
1113
else()
1214
find_dependency(OpenGL)

0 commit comments

Comments
 (0)