Skip to content
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,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.22" 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
4 changes: 3 additions & 1 deletion src/libprojectM/projectM4Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ include(CMakeFindDependencyMacro)

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