Changeset View
Changeset View
Standalone View
Standalone View
recipes-kf5/tier1/sonnet/0001-no-widgets.patch
- This file was added.
1 | commit e5cf922c9bd53c13d05cb8776dde14a9e66c0db1 | ||||
---|---|---|---|---|---|
2 | Author: Volker Krause <vkrause@kde.org> | ||||
3 | Date: Sun Jul 30 13:36:25 2017 +0200 | ||||
4 | | ||||
5 | Allow to build Sonnet without Qt5Widgets | ||||
6 | | ||||
7 | Summary: | ||||
8 | This is useful for cross-compilation, where we only need the QtCore-only | ||||
9 | parsetrigrams build tool on the host and avoids having to pull in a full | ||||
10 | graphics stack for the host build in Yocto. | ||||
11 | | ||||
12 | Reviewers: #frameworks, cordlandwehr | ||||
13 | | ||||
14 | Tags: #frameworks | ||||
15 | | ||||
16 | Differential Revision: https://phabricator.kde.org/D6990 | ||||
17 | | ||||
18 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||||
19 | index 64df939..19bbd17 100644 | ||||
20 | --- a/CMakeLists.txt | ||||
21 | +++ b/CMakeLists.txt | ||||
22 | @@ -17,7 +17,8 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) | ||||
23 | include(KDECMakeSettings) | ||||
24 | | ||||
25 | set(REQUIRED_QT_VERSION 5.6.0) | ||||
26 | -find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets) | ||||
27 | +find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG COMPONENTS Widgets) | ||||
28 | +find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core) | ||||
29 | | ||||
30 | | ||||
31 | include(GenerateExportHeader) | ||||
32 | @@ -43,7 +44,9 @@ endif() | ||||
33 | add_subdirectory(src) | ||||
34 | add_subdirectory(autotests) | ||||
35 | add_subdirectory(data) | ||||
36 | -add_subdirectory(examples) | ||||
37 | +if(TARGET Qt5::Widgets) | ||||
38 | + add_subdirectory(examples) | ||||
39 | +endif() | ||||
40 | | ||||
41 | | ||||
42 | # create a Config.cmake and a ConfigVersion.cmake file and install them | ||||
43 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||||
44 | index cf40289..e6e4212 100644 | ||||
45 | --- a/src/CMakeLists.txt | ||||
46 | +++ b/src/CMakeLists.txt | ||||
47 | @@ -1,3 +1,5 @@ | ||||
48 | add_subdirectory(core) | ||||
49 | add_subdirectory(plugins) | ||||
50 | -add_subdirectory(ui) | ||||
51 | +if(TARGET Qt5::Widgets) | ||||
52 | + add_subdirectory(ui) | ||||
53 | +endif() |