Bug 929227
Summary: | CMake Config files assume wrong directory layout | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Kevin Kofler <kevin> |
Component: | qt5-qtbase | Assignee: | Than Ngo <than> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | ismael, jreznik, kevin, ltinkl, rdieter, rnovacek, than |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-04-10 13:13:56 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Kevin Kofler
2013-03-29 15:00:36 UTC
The way these files were written, they assume that 1. the *Config*.cmake files are all directly in the root of the prefix and 2. the other directories are all relative to that in the default way, e.g. bindir is prefix + "/bin" etc. 1. is definitely wrong, 2. may also be wrong. right, in particular, everything that matches: %{libdir}/cmake/Qt5*/Qt5*Config.cmake contains similar code to set erroneous _qt5*_install_prefix variables Sent query to upstream ml for starters, http://lists.qt-project.org/pipermail/development/2013-March/010614.html The *.cmake.in templates look like this: mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in:get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) src/widgets/Qt5WidgetsConfigExtras.cmake.in:get_filename_component(_qt5_widgets_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) src/corelib/Qt5CoreConfigExtras.cmake.in:get_filename_component(_qt5_corelib_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) src/dbus/Qt5DBusConfigExtras.cmake.in:get_filename_component(_qt5_dbus_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) so the problem is that $${CMAKE_RELATIVE_INSTALL_DIR} vanishes in the installed files. It should probably be "../../qt5", but it's completely replaced away by the .cmake.in → .cmake generation. mkspecs/features/create_cmake.prf: CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/ contains(CMAKE_LIB_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") { CMAKE_LIB_DIR = $$replace(CMAKE_LIB_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", ) CMAKE_RELATIVE_INSTALL_DIR = $$replace(CMAKE_LIB_DIR, "[^/]+", ..) # We need to go up another two levels because the CMake files are # installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME} CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_DIR}../../" } else { CMAKE_LIB_DIR_IS_ABSOLUTE = True } is this part not used or failing somehow? > contains(CMAKE_LIB_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*")
is false because CMAKE_LIB_DIR is not a subdirectory of $${CMAKE_QT_INSTALL_PREFIX_ESCAPED} (but the other way round).
So we enter the CMAKE_LIB_DIR_IS_ABSOLUTE case and the *Config*.cmake files are not written to handle that at all.
There's no code to handle a prefix within the libdir.
Ah, so maybe one of my earlier naive suggestions to set _qt5_prefix to be /usr (instead of %{_libdir}/qt5) may help here, but that may also have other side-effects as well. Yeah, if you do that, it'll probably expect the unsuffixed binaries to be under /usr/bin. I guess we could patch in the suffixes (or patch the path) though. But it might also affect the placement of other files. I'll have a look at create_cmake.prf to see whether I can make it do something sensible, I know both QMake and CMake to some extent. Tried qtbase-5.0.2-rc1, and problem appears to be fixed. I'll do a little more testing to confirm, and import into rawhide. Hrm, still not quite right, per bug #950213 , trying to build Sigil , I get odd output like: CMake Warning at /usr/lib64/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:49 (find_package): Could not find a package configuration file provided by "Qt5Gui" with any of the following names: Qt5GuiConfig.cmake qt5gui-config.cmake Except here they are: /usr/lib64/cmake/Qt5Gui/Qt5GuiConfig.cmake /usr/lib64/cmake/Qt5Gui/Qt5GuiConfigVersion.cmake Ah, upstream pointed me to this: https://codereview.qt-project.org/52778 building... let's see if this one helps %changelog * Wed Apr 10 2013 Rex Dieter <rdieter> - 5.0.2-1 - 5.0.2 - fix cmake config (#929227) confirmed, mmm-mmm good this time. yay. *** Bug 950213 has been marked as a duplicate of this bug. *** Not quite 100% there ... after installing, do in source tree: $ cd /tests/auto/cmake; mkdir build; cd build; cmake ..; $ ctest --output-on-failure Test project /home/rdieter1/pkgs.fedoraproject.org/qt5-qtbase/qtbase-opensource-src-5.0.2/tests/auto/cmake/build Start 1: test_use_modules_function 1/18 Test #1: test_use_modules_function .........***Failed 0.03 sec Internal cmake changing into directory: /home/rdieter1/pkgs.fedoraproject.org/qt5-qtbase/qtbase-opensource-src-5.0.2/tests/auto/cmake/build/test_use_modules_function Error: cmake execution failed CMake Warning at /usr/lib64/cmake/Qt5Core/Qt5CoreMacros.cmake:237 (find_package): Could not find a package configuration file provided by "Qt5Test" with any of the following names: Qt5TestConfig.cmake qt5test-config.cmake Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set "Qt5Test_DIR" to a directory containing one of the above files. If "Qt5Test" provides a separate development package or SDK, be sure it has been installed. Call Stack (most recent call first): CMakeLists.txt:15 (qt5_use_modules) CMake Error at /usr/lib64/cmake/Qt5Core/Qt5CoreMacros.cmake:240 (message): Can not use "Test" module which has not yet been found. Call Stack (most recent call first): CMakeLists.txt:15 (qt5_use_modules) Configuring Configuring incomplete, errors occurred! Start 2: test_wrap_cpp_and_resources 2/18 Test #2: test_wrap_cpp_and_resources ....... Passed 0.49 sec Start 3: test_dependent_modules 3/18 Test #3: test_dependent_modules ............ Passed 1.49 sec Start 4: test_add_resource_options 4/18 Test #4: test_add_resource_options ......... Passed 0.92 sec Start 5: test_wrap_cpp_options 5/18 Test #5: test_wrap_cpp_options ............. Passed 1.11 sec Start 6: test_needsquoting_dirname 6/18 Test #6: test_needsquoting_dirname ......... Passed 1.47 sec Start 7: test_platform_defs_include 7/18 Test #7: test_platform_defs_include ........ Passed 0.90 sec Start 8: test_qtmainwin_library 8/18 Test #8: test_qtmainwin_library ............ Passed 1.06 sec Start 9: test_dbus_module 9/18 Test #9: test_dbus_module .................. Passed 1.72 sec Start 10: test_multiple_find_package 10/18 Test #10: test_multiple_find_package ........ Passed 1.03 sec Start 11: test_add_resources_delayed_file 11/18 Test #11: test_add_resources_delayed_file ... Passed 1.02 sec Start 12: test_private_includes 12/18 Test #12: test_private_includes ............. Passed 1.05 sec Start 13: test_testlib_definitions 13/18 Test #13: test_testlib_definitions .......... Passed 3.07 sec Start 14: test_json_plugin_includes 14/18 Test #14: test_json_plugin_includes ......... Passed 1.05 sec Start 15: test_testlib_no_link_gui 15/18 Test #15: test_testlib_no_link_gui .......... Passed 1.20 sec Start 16: test_testlib_no_link_widgets 16/18 Test #16: test_testlib_no_link_widgets ...... Passed 1.43 sec Start 17: module_includes 17/18 Test #17: module_includes ................... Passed 1.38 sec Start 18: test_concurrent_module 18/18 Test #18: test_concurrent_module ............ Passed 1.03 sec 94% tests passed, 1 tests failed out of 18 Total Test time (real) = 21.46 sec The following tests FAILED: 1 - test_use_modules_function (Failed) Errors while running CTest qt5-qtbase-5.0.2-1.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/FEDORA-2013-4060/qt5-qtbase-5.0.2-1.fc18 qt5-qtbase-5.0.2-1.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/FEDORA-2013-4068/qt5-qtbase-5.0.2-1.fc17 qt5-qtbase-5.0.2-1.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/qt5-qtbase-5.0.2-1.fc19 qt5-qtbase-5.0.2-3.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/qt5-qtbase-5.0.2-3.fc19 qt5-qtbase-5.0.2-2.fc18 has been pushed to the Fedora 18 stable repository. qt5-qtbase-5.0.2-3.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report. |