Commit 31e7d4f5 authored by Ghislain MARY's avatar Ghislain MARY

Use OpenGL find_package provided by CMake instead of our own.

parent 1eb8741d
......@@ -280,8 +280,8 @@ if(ENABLE_GL)
set(ENABLE_GL OFF CACHE BOOL "Enable generic OpenGL rendering support." FORCE)
endif()
else()
find_package(GL)
if(GL_FOUND)
find_package(OpenGL)
if(OPENGL_FOUND)
set(HAVE_GL 1)
else()
set(ENABLE_GL OFF CACHE BOOL "Enable generic OpenGL rendering support." FORCE)
......@@ -429,8 +429,8 @@ endif()
if(Qt5Gui_FOUND)
include_directories(${Qt5Gui_INCLUDE_DIRS} ${Qt5Gui_EGL_INCLUDE_DIRS})
endif()
if(GL_FOUND)
include_directories(${GL_INCLUDE_DIRS})
if(OPENGL_FOUND)
include_directories(${OPENGL_INCLUDE_DIR})
endif()
if(GLX_FOUND)
include_directories(${GLX_INCLUDE_DIRS})
......
############################################################################
# FindGL.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
#
# - Find the GL include file and library
#
# GL_FOUND - system has GL
# GL_INCLUDE_DIRS - the GL include directory
# GL_LIBRARIES - The libraries needed to use GL
include(CheckIncludeFile)
include(CheckSymbolExists)
find_path(GL_INCLUDE_DIRS
NAMES GL/gl.h
PATH_SUFFIXES include
)
if(GL_INCLUDE_DIRS)
if(WIN32)
check_include_file(GL/gl.h HAVE_GL_GL_H "-include windows.h")
else()
check_include_file(GL/gl.h HAVE_GL_GL_H)
endif()
endif()
find_library(GL_LIBRARIES
NAMES GL
PATH_SUFFIXES bin lib
)
if(GL_LIBRARIES)
# TODO: check symbols in gl
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GL
DEFAULT_MSG
GL_INCLUDE_DIRS HAVE_GL_GL_H GL_LIBRARIES
)
mark_as_advanced(GL_INCLUDE_DIRS HAVE_GL_GL_H GL_LIBRARIES)
......@@ -394,7 +394,7 @@ if(ENABLE_VIDEO)
videofilters/turbojpegwriter.c
)
endif()
if(GL_FOUND OR Qt5Gui_FOUND)
if(OPENGL_FOUND OR Qt5Gui_FOUND)
list(APPEND VOIP_SOURCE_FILES_C
utils/opengl_functions.c
utils/opengles_display.c
......@@ -455,7 +455,7 @@ add_custom_target(ms2-voipdescs-header
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/voipdescs.h"
)
if(APPLE OR ANDROID OR GL_FOUND OR Qt5Gui_FOUND)
if(APPLE OR ANDROID OR OPENGL_FOUND OR Qt5Gui_FOUND)
find_package(PythonInterp REQUIRED)
find_program(SED_PROGRAM sed)
if(NOT SED_PROGRAM)
......@@ -600,8 +600,8 @@ endif()
if(Qt5Gui_FOUND)
list(APPEND VOIP_LIBS ${Qt5Gui_LIBRARIES})
endif()
if(GL_FOUND)
list(APPEND VOIP_LIBS ${GL_LIBRARIES})
if(OPENGL_FOUND)
list(APPEND VOIP_LIBS ${OPENGL_LIBRARIES})
endif()
if(GLX_FOUND)
list(APPEND VOIP_LIBS ${GLX_LIBRARIES})
......@@ -629,7 +629,7 @@ if (BCGG729_FOUND)
list(APPEND VOIP_LIBS ${BCG729_LIBRARIES})
endif()
set(MS2_VOIP_DEPENDENCIES ms2-git-version ms2-voipdescs-header)
if(APPLE OR ANDROID OR GL_FOUND OR Qt5Gui_FOUND)
if(APPLE OR ANDROID OR OPENGL_FOUND OR Qt5Gui_FOUND)
list(APPEND MS2_VOIP_DEPENDENCIES ms2-yuv2rgb-fs-header ms2-yuv2rgb-vs-header)
endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment