Commit 42c3aae8 authored by Ghislain MARY's avatar Ghislain MARY

Simplify search for OpenGL headers on Windows and prevent linking against...

Simplify search for OpenGL headers on Windows and prevent linking against OpenGL library that is not necessary.
parent 26624224
......@@ -273,8 +273,8 @@ if(ENABLE_XV)
endif()
if(ENABLE_GL)
if(WIN32)
find_package(Qt5 COMPONENTS Gui)
if(Qt5Gui_FOUND)
find_package(QtAngle)
if(QTANGLE_FOUND)
set(HAVE_GL 1)
else()
set(ENABLE_GL OFF CACHE BOOL "Enable generic OpenGL rendering support." FORCE)
......@@ -426,8 +426,8 @@ endif()
if(XV_FOUND)
include_directories(${XV_INCLUDE_DIRS})
endif()
if(Qt5Gui_FOUND)
include_directories(${Qt5Gui_INCLUDE_DIRS} ${Qt5Gui_EGL_INCLUDE_DIRS})
if(QTANGLE_FOUND)
include_directories(${QTANGLE_INCLUDE_DIRS})
endif()
if(OPENGL_FOUND)
include_directories(${OPENGL_INCLUDE_DIR})
......
############################################################################
# FindQtAngle.txt
# Copyright (C) 2017 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 QtAngle include file and library
#
# QTANGLE_FOUND - system has QtAngle
# QTANGLE_INCLUDE_DIRS - the QtAngle include directory
find_path(QTANGLE_INCLUDE_DIRS
NAMES QtANGLE/GLES3/gl3.h
PATH_SUFFIXES include
)
if(QTANGLE_INCLUDE_DIRS)
list(APPEND QTANGLE_INCLUDE_DIRS "${QTANGLE_INCLUDE_DIRS}/QtANGLE")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(QTANGLE
DEFAULT_MSG
QTANGLE_INCLUDE_DIRS
)
mark_as_advanced(QTANGLE_INCLUDE_DIRS)
......@@ -48,11 +48,6 @@ if(@ENABLE_ZRTP@)
find_package(BZRTP)
endif()
endif()
if(@ENABLE_GL@)
if(WIN32)
find_package(Qt5 COMPONENTS Gui)
endif()
endif()
get_filename_component(MEDIASTREAMER2_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
......@@ -75,9 +70,8 @@ if(BZRTP_FOUND)
list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${BZRTP_INCLUDE_DIRS})
list(APPEND MEDIASTREAMER2_LIBRARIES ${BZRTP_LIBRARIES})
endif()
if(Qt5Gui_FOUND)
list(APPEND MEDIASTREAMER2_INCLUDE_DIRS ${Qt5Gui_INCLUDE_DIRS} ${Qt5Gui_EGL_INCLUDE_DIRS})
list(APPEND MEDIASTREAMER2_LIBRARIES ${Qt5Gui_LIBRARIES})
if(@QTANGLE_FOUND@)
list(APPEND MEDIASTREAMER2_INCLUDE_DIRS "@QTANGLE_INCLUDE_DIRS@")
endif()
set(MEDIASTREAMER2_CPPFLAGS @MEDIASTREAMER2_CPPFLAGS@)
set(MEDIASTREAMER2_LDFLAGS "@LINK_FLAGS_STR@")
......
......@@ -31,7 +31,7 @@
#include <GLES2/gl2ext.h>
#elif defined(_WIN32)
#if !defined(QOPENGLFUNCTIONS_H)
#include <GLES2/gl2.h>
#include <GLES3/gl3.h>
#endif
#elif !defined(QOPENGLFUNCTIONS_H) // glew is already included by QT.
#include <GL/glew.h>
......
......@@ -394,7 +394,7 @@ if(ENABLE_VIDEO)
videofilters/turbojpegwriter.c
)
endif()
if(OPENGL_FOUND OR Qt5Gui_FOUND)
if(OPENGL_FOUND OR QTANGLE_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 OPENGL_FOUND OR Qt5Gui_FOUND)
if(APPLE OR ANDROID OR OPENGL_FOUND OR QTANGLE_FOUND)
find_package(PythonInterp REQUIRED)
find_program(SED_PROGRAM sed)
if(NOT SED_PROGRAM)
......@@ -597,12 +597,6 @@ endif()
if(XV_FOUND)
list(APPEND VOIP_LIBS ${XV_LIBRARIES})
endif()
if(Qt5Gui_FOUND)
list(APPEND VOIP_LIBS ${Qt5Gui_LIBRARIES})
endif()
if(OPENGL_FOUND)
list(APPEND VOIP_LIBS ${OPENGL_LIBRARIES})
endif()
if(GLX_FOUND)
list(APPEND VOIP_LIBS ${GLX_LIBRARIES})
endif()
......@@ -629,7 +623,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 OPENGL_FOUND OR Qt5Gui_FOUND)
if(APPLE OR ANDROID OR OPENGL_FOUND OR QTANGLE_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