Bug 1125021 - Broken CMake in Qt5GuiConfigExtras.cmake from -devel
Summary: Broken CMake in Qt5GuiConfigExtras.cmake from -devel
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: qt5-qtbase
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ngo Than
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-30 21:35 UTC by Chuck Atkins
Modified: 2014-11-10 14:28 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-10 14:28:34 UTC


Attachments (Terms of Use)
Dummy project CMake file (87 bytes, text/plain)
2014-07-30 21:35 UTC, Chuck Atkins
no flags Details
Patch to fix the afected Qt5GuiConfigExtras.cmake (692 bytes, patch)
2014-07-30 21:37 UTC, Chuck Atkins
no flags Details | Diff
Patch to fix the afected Qt5GuiConfigExtras.cmake based on the upstream resolution (2.20 KB, patch)
2014-07-30 22:26 UTC, Chuck Atkins
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Qt Bug Tracker QTBUG-39859 None None None Never

Description Chuck Atkins 2014-07-30 21:35:34 UTC
Created attachment 922742 [details]
Dummy project CMake file

Description of problem:
The installed CMake config files for the QtGui component are broken. 

Version-Release number of selected component:
At least qt5-qtbase-devel-5.3.1-5.fc20.x86_64, posibly older.

How reproducible:
Every time.

Steps to Reproduce:
1. Create a dummy CMakeLists.txt file in a directory "source":
----------BEGIN CMakeLists.txt--------
cmake_minimum_required(VERSION 2.8.12)
project(TestQT5)
find_package(Qt5 REQUIRED Gui)
----------END CMakeLists.txt----------

2. From a seperate build directory, run cmake:
$ cd build/
$ /usr/bin/cmake ../source

Actual results:
$ /usr/bin/cmake ../source
...
CMake Error at /usr/lib64/cmake/Qt5Gui/Qt5GuiConfig.cmake:15 (message):
  The imported target "Qt5::Gui" references the file

     "Qt5Gui_EGL_LIBRARY-NOTFOUND"

  but this file does not exist.  Possible reasons include:
...
-- Configuring incomplete, errors occurred!

Expected results:
$ /usr/bin/cmake ../source
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done

Additional info:
The underlying problem apears to be that the macros in Qt5GuiConfigExtras.cmake are making some assumptions about the existence of libraries.  This can be fixed with a trivial path to check that the libraries were successfully found before attempting to use them:

BEGIN PATCH
--- /usr/lib64/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake	2014-07-30 17:30:01.956232844 -0400
+++ /usr/lib64/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake.fixed	2014-07-30 17:30:12.348200201 -0400
@@ -23,7 +23,7 @@
                 set(_Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE TRUE)
                 unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE)
                 list(APPEND Qt5Gui_${Name}_LIBRARIES ${_lib})
-            else ()
+            elseif (Qt5Gui_${_cmake_lib_name}_LIBRARY)
                 add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED)
                 set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_${Name}_INCLUDE_DIRS})
END PATCH

Comment 1 Chuck Atkins 2014-07-30 21:37:01 UTC
Created attachment 922743 [details]
Patch to fix the afected Qt5GuiConfigExtras.cmake

Comment 2 Chuck Atkins 2014-07-30 22:26:48 UTC
Created attachment 922765 [details]
Patch to fix the afected Qt5GuiConfigExtras.cmake based on the upstream resolution

Comment 3 Chuck Atkins 2014-07-30 22:34:40 UTC
See bug report upstream https://bugreports.qt-project.org/browse/QTBUG-39859 and upstream fix 8ee19816 in the qtbase submodule https://qt.gitorious.org/qt/qtbase/commit/8ee19816c87918136ea84f8451ab9e9c9764c8de

Comment 4 Rex Dieter 2014-11-10 14:28:34 UTC
I would appear the upstream fix is already applied to qtbase-5.3.2, which is already in stable updates.

Please re-open if you have any further related issues.


Note You need to log in before you can comment on or make changes to this bug.