qt-gstreamer: Fix build with Qt 5.11
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
From aaff08c014d25266ce141fe378757ccb6fa18494 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
|
||||
Date: Sun, 3 Jun 2018 23:25:29 +0200
|
||||
Subject: [PATCH] FindQt4or5.cmake: Optionally create qt5_use_modules to fix
|
||||
build with Qt 5.11
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
|
||||
---
|
||||
cmake/modules/FindQt4or5.cmake | 51 ++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 51 insertions(+)
|
||||
|
||||
diff --git a/cmake/modules/FindQt4or5.cmake b/cmake/modules/FindQt4or5.cmake
|
||||
index 855a48e..46976f7 100644
|
||||
--- a/cmake/modules/FindQt4or5.cmake
|
||||
+++ b/cmake/modules/FindQt4or5.cmake
|
||||
@@ -17,6 +17,57 @@
|
||||
|
||||
set(QT_VERSION "4" CACHE STRING "Qt version used for the build")
|
||||
|
||||
+if (NOT COMMAND qt5_use_modules)
|
||||
+ macro(qt5_use_modules _target _link_type)
|
||||
+ if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
|
||||
+ if(CMAKE_WARN_DEPRECATED)
|
||||
+ set(messageType WARNING)
|
||||
+ endif()
|
||||
+ if(CMAKE_ERROR_DEPRECATED)
|
||||
+ set(messageType FATAL_ERROR)
|
||||
+ endif()
|
||||
+ if(messageType)
|
||||
+ message(${messageType} "The qt5_use_modules macro is obsolete. Use target_link_libraries with IMPORTED targets instead.")
|
||||
+ endif()
|
||||
+ endif()
|
||||
+
|
||||
+ if (NOT TARGET ${_target})
|
||||
+ message(FATAL_ERROR "The first argument to qt5_use_modules must be an existing target.")
|
||||
+ endif()
|
||||
+ if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE" )
|
||||
+ set(_qt5_modules ${ARGN})
|
||||
+ set(_qt5_link_type ${_link_type})
|
||||
+ else()
|
||||
+ set(_qt5_modules ${_link_type} ${ARGN})
|
||||
+ endif()
|
||||
+
|
||||
+ if ("${_qt5_modules}" STREQUAL "")
|
||||
+ message(FATAL_ERROR "qt5_use_modules requires at least one Qt module to use.")
|
||||
+ endif()
|
||||
+
|
||||
+ foreach(_module ${_qt5_modules})
|
||||
+ if (NOT Qt5${_module}_FOUND)
|
||||
+ find_package(Qt5${_module} PATHS "${_Qt5_COMPONENT_PATH}" NO_DEFAULT_PATH)
|
||||
+ if (NOT Qt5${_module}_FOUND)
|
||||
+ message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
|
||||
+ endif()
|
||||
+ endif()
|
||||
+ target_link_libraries(${_target} ${_qt5_link_type} ${Qt5${_module}_LIBRARIES})
|
||||
+ set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_module}_INCLUDE_DIRS})
|
||||
+ set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_module}_COMPILE_DEFINITIONS})
|
||||
+ set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
|
||||
+ set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG)
|
||||
+ set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG)
|
||||
+ if (Qt5_POSITION_INDEPENDENT_CODE
|
||||
+ AND (CMAKE_VERSION VERSION_LESS 2.8.12
|
||||
+ AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
|
||||
+ OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)))
|
||||
+ set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE})
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+ endmacro()
|
||||
+endif()
|
||||
+
|
||||
macro(_qt4or5_component_name_to_qt_component qt_component component)
|
||||
if (${component} STREQUAL "Widgets" AND ${QT_VERSION} STREQUAL "4")
|
||||
set(${qt_component} "Gui")
|
||||
--
|
||||
2.14.3
|
||||
|
||||
@@ -18,6 +18,7 @@ DEPENDS += " \
|
||||
SRC_URI = " \
|
||||
http://gstreamer.freedesktop.org/src/${BPN}/${BPN}-${PV}.tar.xz \
|
||||
file://0001-Fix-compilation-with-GStreamer-1-5-1.patch \
|
||||
file://0002-FindQt4or5.cmake-Optionally-create-qt5_use_modules-t.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "fd794045a828c184acc1794b08a463fd"
|
||||
SRC_URI[sha256sum] = "9f3b492b74cad9be918e4c4db96df48dab9c012f2ae5667f438b64a4d92e8fd4"
|
||||
|
||||
Reference in New Issue
Block a user