Created attachment 1696964 [details] Cmake file showing the problem Packaging split of Qt5 devel / private-devel breaks Qt's Cmake scripts. The Qt5 QtFooConfig.cmake modules define additional targets (qt, Qt5::GuiPrivate, Qt5::CorePrivate) conditionally if the private header files for each module are installed. Unfortunately, the do this by checking for particular subdirectories within the module's include prefix. Unfortunately, Fedora is packaging these directories in the *non private* RPM, but of course the actual header files are in the private-devel RPM, and hence the targets defined by Qt5's CMake are useless: they report the private headers as being available, when they are not. Eg, qt5-qtbase-devel contains: /usr/include/qt5/QtCore/5.13.2/QtCore (an empty directory!) As a result, Qt5::CorePrivate will be defined by: /usr/lib64/cmake/Qt5Core/Qt5CoreConfig.cmake Since it uses the existence of this directory, to decide that the private headers are available. Version-Release number of selected component (if applicable): applies to all versions of the qt5 packages on Fedora, it seems How reproducible: Consistently Steps to Reproduce: 1. create a new directory 2. copy the attached CMake file to that directory, renaming to 'CMakeLists.txt' 3. run 'cmake .' in that directory Actual results: - GuiPrivate and CorePrivate targets are reported as available, regardless of whether the private headers are installed or not Expected results: - GuiPrivate and CorePrivate should not be available, unless qt5-qtbase-private-devel RPM is installed
Here's a link to the task which introduced the split: https://bugzilla.redhat.com/show_bug.cgi?id=1233829 Note that on Debian, the -private-dev packages do not have this issue (CMake detection of Qt5::GuiPrivate etc works correctly)
So, fix is to for the -private pkg to own not only the private/ dir but the parent as well? E.g. not only /usr/include/qt5/QtCore/5.13.2/QtCore/private/ but /usr/include/qt5/QtCore/5.13.2/QtCore/ too?
I would recommend that the 'versioned' dir is included as well, i.e: qtbase-devel: /usr/include/qt5/QtCore qtbase-private-devel: /usr/include/qt5/QtCore/5.13.2 This would be most consistent with what the CMake QtFooConfig.cmake files check for. Note this should also mean that for QtGui, the 'qpa' header files, which are currently included in qtbase-devel, should move to qtbase-private-devel. In my opinion this is correct, since QPAs are tied to their specific Qt version : that's why those files reside in the versioned subdir. Here's an excerpt from /usr/lib64/cmake/Qt5Gui/Qt5GuiConfig.cmake ==================================================== set(_Qt5Gui_OWN_INCLUDE_DIRS "${_qt5Gui_install_prefix}/include/qt5/" "${_qt5Gui_install_prefix}/include/qt5/QtGui") set(Qt5Gui_PRIVATE_INCLUDE_DIRS "${_qt5Gui_install_prefix}/include/qt5/QtGui/5.13.2" "${_qt5Gui_install_prefix}/include/qt5/QtGui/5.13.2/QtGui" ) ... set(_Qt5Gui_PRIVATE_DIRS_EXIST TRUE) foreach (_Qt5Gui_PRIVATE_DIR ${Qt5Gui_OWN_PRIVATE_INCLUDE_DIRS}) if (NOT EXISTS ${_Qt5Gui_PRIVATE_DIR}) set(_Qt5Gui_PRIVATE_DIRS_EXIST FALSE) endif() endforeach() if (_Qt5Gui_PRIVATE_DIRS_EXIST) add_library(Qt5::GuiPrivate INTERFACE IMPORTED) set_property(TARGET Qt5::GuiPrivate PROPERTY ... endif() ====================================================
This should do it, https://src.fedoraproject.org/rpms/qt5-qtbase/c/47664d654e0b737ffd9155d56aba5c91c665c1fc?branch=master