diff --git a/CMakeLists.txt b/CMakeLists.txt index b572ba781..f6536a9ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,6 +183,10 @@ if(NOT OPENGL_LIBRARIES AND USING_GLES2) set(OPENGL_LIBRARIES GLESv2 EGL) endif() +if(NOT OPENGL_LIBRARIES) + find_package(OpenGL REQUIRED) +endif() + if(USING_EGL) if(NOT EGL_LIBRARIES) set(EGL_LIBRARIES EGL) @@ -190,10 +194,6 @@ if(USING_EGL) set(OPENGL_LIBRARIES ${OPENGL_LIBRARIES} ${EGL_LIBRARIES}) endif() -if(NOT OPENGL_LIBRARIES) - find_package(OpenGL REQUIRED) -endif() - find_package(SDL2) include(FindThreads)