Changeset View
Changeset View
Standalone View
Standalone View
recipes-kf5/tier1/kconfig/0001-no-gui.patch
- This file was added.
1 | commit 61ed46048d3ae7aa182102d192bab3e49339a010 | ||||
---|---|---|---|---|---|
2 | Author: Volker Krause <vkrause@kde.org> | ||||
3 | Date: Sun Jul 30 15:47:29 2017 +0200 | ||||
4 | | ||||
5 | Allow to build KConfig without Qt5Gui | ||||
6 | | ||||
7 | This is particularly useful for cross-compilation, where we only need the | ||||
8 | kconfig_compiler on the host system. | ||||
9 | | ||||
10 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||||
11 | index 5e50ba5..458630e 100644 | ||||
12 | --- a/CMakeLists.txt | ||||
13 | +++ b/CMakeLists.txt | ||||
14 | @@ -12,7 +12,8 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) | ||||
15 | | ||||
16 | set(REQUIRED_QT_VERSION 5.6.0) | ||||
17 | | ||||
18 | -find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Gui Xml) | ||||
19 | +find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Xml) | ||||
20 | +find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG OPTIONAL_COMPONENTS Gui) | ||||
21 | include(KDEInstallDirs) | ||||
22 | include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) | ||||
23 | include(KDECMakeSettings) | ||||
24 | diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt | ||||
25 | index c1ae1de..7d6698f 100644 | ||||
26 | --- a/autotests/CMakeLists.txt | ||||
27 | +++ b/autotests/CMakeLists.txt | ||||
28 | @@ -52,6 +52,7 @@ ecm_add_tests( | ||||
29 | | ||||
30 | target_include_directories(test_kconf_update PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src/kconf_update) | ||||
31 | | ||||
32 | +if(TARGET Qt5::Gui) | ||||
33 | ecm_add_tests( | ||||
34 | kconfigguitest.cpp | ||||
35 | kconfigloadertest.cpp | ||||
36 | @@ -62,4 +63,4 @@ ecm_add_tests( | ||||
37 | ) | ||||
38 | | ||||
39 | add_subdirectory(kconfig_compiler) | ||||
40 | - | ||||
41 | +endif() | ||||
42 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||||
43 | index 998a1d5..d4ca886 100644 | ||||
44 | --- a/src/CMakeLists.txt | ||||
45 | +++ b/src/CMakeLists.txt | ||||
46 | @@ -1,5 +1,7 @@ | ||||
47 | add_subdirectory(core) | ||||
48 | -add_subdirectory(gui) | ||||
49 | +if(TARGET Qt5::Gui) | ||||
50 | + add_subdirectory(gui) | ||||
51 | +endif() | ||||
52 | add_subdirectory(kconfig_compiler) | ||||
53 | add_subdirectory(kconf_update) | ||||
54 | add_subdirectory(kreadconfig) | ||||
55 | diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt | ||||
56 | index 9b7491c..46fabd5 100644 | ||||
57 | --- a/src/core/CMakeLists.txt | ||||
58 | +++ b/src/core/CMakeLists.txt | ||||
59 | @@ -1,6 +1,3 @@ | ||||
60 | - | ||||
61 | -find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) | ||||
62 | - | ||||
63 | set(libkconfigcore_SRCS | ||||
64 | kconfig.cpp | ||||
65 | kconfigbase.cpp | ||||
66 | diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt | ||||
67 | index 9659326..08786d3 100644 | ||||
68 | --- a/src/gui/CMakeLists.txt | ||||
69 | +++ b/src/gui/CMakeLists.txt | ||||
70 | @@ -1,7 +1,3 @@ | ||||
71 | - | ||||
72 | -find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) | ||||
73 | -find_package(Qt5Xml ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) | ||||
74 | - | ||||
75 | set(libkconfiggui_SRCS | ||||
76 | kconfiggui.cpp | ||||
77 | kconfiggroupgui.cpp | ||||
78 | diff --git a/src/kconf_update/CMakeLists.txt b/src/kconf_update/CMakeLists.txt | ||||
79 | index b1342a8..db11511 100644 | ||||
80 | --- a/src/kconf_update/CMakeLists.txt | ||||
81 | +++ b/src/kconf_update/CMakeLists.txt | ||||
82 | @@ -1,5 +1,3 @@ | ||||
83 | -find_package(Qt5Core ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) | ||||
84 | - | ||||
85 | remove_definitions(-DQT_NO_CAST_FROM_ASCII) | ||||
86 | | ||||
87 | ########### next target ############### | ||||
88 | diff --git a/src/kconfig_compiler/CMakeLists.txt b/src/kconfig_compiler/CMakeLists.txt | ||||
89 | index 004a649..dc0a08d 100644 | ||||
90 | --- a/src/kconfig_compiler/CMakeLists.txt | ||||
91 | +++ b/src/kconfig_compiler/CMakeLists.txt | ||||
92 | @@ -16,8 +16,6 @@ else() | ||||
93 | add_executable(KF5::kconfig_compiler ALIAS kconfig_compiler) | ||||
94 | endif() | ||||
95 | | ||||
96 | -find_package(Qt5Xml ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) | ||||
97 | - | ||||
98 | target_link_libraries(kconfig_compiler Qt5::Xml) | ||||
99 | | ||||
100 | ecm_mark_nongui_executable(kconfig_compiler) |