Fix several build system errors
ClosedPublic

Authored by alexeymin on Oct 2 2019, 1:33 PM.

Details

Summary

This patch fixes two different, but closely related buil system errors.

First one is about making KF5IconThemes and KF5ConfigWidgets really optional as intended. Without this patch, on a system with only Qt5 and other Tier 1 framework libs installed, you will get thw following cmake configure error:

  • The following REQUIRED packages have not been found:
  • KF5 (required version >= 5.62.0)

(full build logs below)

Second error is revealed after the first one is fixed: plugin/kquickstyleitem.cpp includes ksharedconfig.h, but it cannot be found, because KConfig was not specified as dependency.

qqc2-desktop-style is supposed to be Tier 1 framework, however it depends on several other Tier 1 frameworks (which is forbidden for Tier 1 frameworks?) and optionally depends on some Tier 3 frameworks, so shouldn't it be at least Tier 2 framework? Or even higher?
Quote from https://api.kde.org/frameworks/index.html : "Tier 1 frameworks depend only on Qt (and possibly a small number of other third-party libraries), so can easily be used by any Qt-based project." - this is not true for qqc2-desktop-style.

Test Plan

without this patch, try to build with only Qt5 and Tier 1 frameworks installed and see it fails

Diff Detail

Repository
R858 Qt Quick Controls 2: Desktop Style
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alexeymin created this revision.Oct 2 2019, 1:33 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 2 2019, 1:33 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
alexeymin requested review of this revision.Oct 2 2019, 1:33 PM
alexeymin retitled this revision from qqc2-desktop-style: Fix several builsystem errors to Fix several builsystem errors.Oct 2 2019, 1:44 PM
alexeymin edited the summary of this revision. (Show Details)

First of all, if you try to build qqc2-desktop-style on a system with only Qt5 and other Tier 1 frameworks installed, you will get the following cmake configure log (https://paste.ubuntu.com/p/YRjSRWm9g6/):

OS Kubuntu 18.04 LTS
Custom-built Qt 5.14 in ~/prefix514
Other Tier 1 Frameworks also built and installed in ~/prefix514

The C compiler identification is GNU 7.4.0
The CXX compiler identification is GNU 7.4.0
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
Detecting C compile features
Detecting C compile features - 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
Detecting CXX compile features
Detecting CXX compile features - done
Installing in the same prefix as Qt, adopting their path scheme.
Setting build type to 'Debug' as none was specified.
Looking for __GLIBC__
Looking for __GLIBC__ - found
Performing Test _OFFT_IS_64BIT
Performing Test _OFFT_IS_64BIT - Success
Performing Test HAVE_DATE_TIME
Performing Test HAVE_DATE_TIME - Success
Found KF5Kirigami2: /home/minnehanov/prefix514/lib/x86_64-linux-gnu/cmake/KF5Kirigami2/KF5Kirigami2Config.cmake (found version "5.63.0") 
Found KF5: success (found suitable version "5.63.0", minimum required is "5.62.0") found components: Kirigami2 
Could NOT find KF5IconThemes (missing: KF5IconThemes_DIR)
Could NOT find KF5IconThemes: found neither KF5IconThemesConfig.cmake nor kf5iconthemes-config.cmake 
Could NOT find KF5ConfigWidgets (missing: KF5ConfigWidgets_DIR)
Could NOT find KF5ConfigWidgets: found neither KF5ConfigWidgetsConfig.cmake nor kf5configwidgets-config.cmake 
Could NOT find KF5 (missing: IconThemes ConfigWidgets) (Required is at least version "5.62.0")
Found X11: /usr/include   
Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
Looking for gethostbyname
Looking for gethostbyname - found
Looking for connect
Looking for connect - found
Looking for remove
Looking for remove - found
Looking for shmat
Looking for shmat - found
Looking for IceConnectionNumber in ICE
Looking for IceConnectionNumber in ICE - found
Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
The following OPTIONAL packages have been found:

 * Freetype
 * Fontconfig
 * X11
 * Qt5X11Extras (required version >= 5.11.0)
 * PkgConfig

-- The following REQUIRED packages have been found:

 * ECM (required version >= 5.62.0)
 * Qt5Network (required version >= 5.14.0)
 * Qt5Qml (required version >= 5.14.0)
 * Qt5QmlModels (required version >= 5.14.0)
 * Qt5Quick
 * Qt5Gui
 * Qt5Widgets
 * Qt5QuickControls2
 * Qt5 (required version >= 5.11.0)
 * Qt5Core (required version >= 5.11.0)
 * KF5Kirigami2 (required version >= 5.62.0)

-- The following OPTIONAL packages have not been found:

 * KF5IconThemes (required version >= 5.62.0)
 * KF5ConfigWidgets (required version >= 5.62.0)

-- The following REQUIRED packages have not been found:

 * KF5 (required version >= 5.62.0)

CMake Error at /home/minnehanov/prefix514/share/cmake-3.15/Modules/FeatureSummary.cmake:457 (message):
  feature_summary() Error: REQUIRED package(s) are missing, aborting CMake
  run.

So, at first cmake says that KF5 is found with Kirigami as required dependency, and then next invocation of find_package - KF5 is NOT found, with optional deps of IconThemes and ConfigWidgets. Optional, but still not found. So, to solve that problem, change the second find_package invocaition to a two separate calls for individual components, not involving KF5 as whole.

alexeymin added a comment.EditedOct 2 2019, 1:53 PM

Second error is revealed after the first one is fixed:

Scanning dependencies of target qqc2desktopstyleplugin
[ 40%] Building CXX object plugin/CMakeFiles/qqc2desktopstyleplugin.dir/qqc2desktopstyleplugin_autogen/mocs_compilation.cpp.o
[ 60%] Building CXX object plugin/CMakeFiles/qqc2desktopstyleplugin.dir/qqc2desktopstyleplugin.cpp.o
[ 80%] Building CXX object plugin/CMakeFiles/qqc2desktopstyleplugin.dir/kquickstyleitem.cpp.o
/home/minnehanov/dev/kde/fw/qqc2-desktop-style/plugin/kquickstyleitem.cpp:54:10: fatal error: ksharedconfig.h: No such file or directory
 #include <ksharedconfig.h>
          ^~~~~~~~~~~~~~~~~
compilation terminated.

plugin/kquickstyleitem.cpp includes ksharedconfig.h but KConfig was not specified as a link dependency for this target. Previously it was found transitively via KF5ConfigWidgets I guess? Now without those optional dependencies it cannot be built. So KConfig should explicitly be specified as another required KF5 dependency, along with Kirigami.

alexeymin edited the summary of this revision. (Show Details)Oct 2 2019, 1:58 PM
alexeymin retitled this revision from Fix several builsystem errors to Fix several build system errors.
This revision was not accepted when it landed; it landed in state Needs Review.Oct 2 2019, 5:11 PM
Closed by commit R858:9ddd3ba2f531: qqc2-desktop-style: Fix several builsystem errors (authored by Aleksey Minnekhanov <aleksei.minnehanov@myoffice.team>). · Explain Why
This revision was automatically updated to reflect the committed changes.
alexeymin reopened this revision.Oct 2 2019, 5:25 PM

Phabricator, you're drunk, it is not pushed to master

krop added a subscriber: krop.Oct 2 2019, 5:43 PM

Note: the metainfo file says this framework is tier 3.

The subgroup value looks wrong

CMakeLists.txt
40–41

KF5_DEP_VERSION is lost here

alexeymin updated this revision to Diff 67233.Oct 2 2019, 11:27 PM
  • Bring back missing KF5_DEP_VERSION
alexeymin marked an inline comment as done.EditedOct 2 2019, 11:31 PM

Right, so I was fooled by having qqc2-desktop-style listed as Tier 1 on our main documentation page https://api.kde.org/frameworks/index.html . If it is really Tier 3, then maybe it does not even make sense to make IconThemes and ConfigWidgets optional?

The subgroup value looks wrong

And maybe should I include a change to metainfo.yaml modifying subgroup: Tier 1 to subgroup: Tier 3 then?

mart accepted this revision.Oct 4 2019, 10:38 AM
This revision is now accepted and ready to land.Oct 4 2019, 10:38 AM
This revision was automatically updated to reflect the committed changes.