Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Link to OpenGL::GL
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslo committed Jan 4, 2018
1 parent cf021b6 commit 245e1e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -888,11 +888,11 @@ elseif(HAIKU)
endif(SDL_TIMERS)

if(VIDEO_OPENGL)
# TODO: Use FIND_PACKAGE(OpenGL) instead
find_package(OpenGL REQUIRED)
set(SDL_VIDEO_OPENGL 1)
set(SDL_VIDEO_OPENGL_BGL 1)
set(SDL_VIDEO_RENDER_OGL 1)
list(APPEND EXTRA_LIBS GL)
list(APPEND EXTRA_LIBS OpenGL::GL)
set(HAVE_VIDEO_OPENGL TRUE)
endif()

Expand Down
4 changes: 4 additions & 0 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ if("@APPLE@")
endif()
endif()

if("@SDL_VIDEO_OPENGL@")
find_package(OpenGL REQUIRED)
endif()

find_package(Threads REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
Expand Down
3 changes: 2 additions & 1 deletion cmake/sdlchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ macro(CheckOpenGL)
set(SDL_VIDEO_OPENGL_GLX 1)
endif ()
set(SDL_VIDEO_RENDER_OGL 1)
list(APPEND EXTRA_LIBS GL)
find_package(OpenGL REQUIRED)
list(APPEND EXTRA_LIBS OpenGL::GL)
endif()
set (CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
endif()
Expand Down

0 comments on commit 245e1e2

Please sign in to comment.