From 94f98294def4dc52fed6cf4c70149b62b8193b72 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 24 Jun 2020 16:36:45 +0100 Subject: [PATCH] Workaround Fedora Qt packaging bug Use a manual include file, instead of the official method, to check if the Qt5 private headers are installed or not. --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e6623fc9..45e401922 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ include (CheckVariableExists) include (CheckCSourceCompiles) include (CheckCXXSourceCompiles) include (CheckIncludeFile) +include (CheckIncludeFileCXX) cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0042 NEW) # Mac RPATH policy @@ -379,7 +380,13 @@ if (ENABLE_QT) set(ENABLE_FGQCANVAS OFF) endif() - if (TARGET Qt5::GuiPrivate) + # we would ideally use TARGET::Qt5GuiPrivate but Fedora broke it + # perform a manual check instead + # see https://bugzilla.redhat.com/show_bug.cgi?id=1846613 + set (CMAKE_REQUIRED_INCLUDES ${Qt5Gui_PRIVATE_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS}) + check_include_file_cxx("private/qopenglcontext_p.h" REALLY_HAVE_QGUIPRIVATE) + + if (REALLY_HAVE_QGUIPRIVATE) message(STATUS "Have QtGUI private headers") set(ENABLE_QQ_UI 1) else()