Merge lp:~nick-dedekind/unity8/plugins.qmltypes into lp:unity8

Proposed by Nick Dedekind
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 76
Merged at revision: 86
Proposed branch: lp:~nick-dedekind/unity8/plugins.qmltypes
Merge into: lp:unity8
Diff against target: 268 lines (+81/-73)
13 files modified
cmake/modules/Plugins.cmake (+48/-0)
plugins/HudClient/CMakeLists.txt (+5/-12)
plugins/HudClient/qmldir (+1/-0)
plugins/LightDM/CMakeLists.txt (+5/-12)
plugins/LightDM/qmldir (+1/-0)
plugins/ListViewWithPageHeader/CMakeLists.txt (+5/-12)
plugins/ListViewWithPageHeader/qmldir (+1/-0)
plugins/Ubuntu/Gestures/CMakeLists.txt (+5/-13)
plugins/Ubuntu/Gestures/qmldir (+1/-0)
plugins/Unity/CMakeLists.txt (+5/-12)
plugins/Unity/qmldir (+1/-0)
plugins/Utils/CMakeLists.txt (+2/-12)
plugins/Utils/qmldir (+1/-0)
To merge this branch: bzr merge lp:~nick-dedekind/unity8/plugins.qmltypes
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Michael Zanetti (community) Needs Fixing
Michał Sawicz Needs Fixing
Review via email: mp+172517@code.launchpad.net

Commit message

Added plugin cmake procedure for qmltypes files.

Description of the change

Added plugin cmake procedure for qmltypes files.

To post a comment you must log in.
69. By Nick Dedekind

added eof new lines.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

cd /tmp/buildd/unity8-7.81.3/obj-x86_64-linux-gnu/plugins/Ubuntu/Gestures && qmlplugindump -notrelocatable Ubuntu.Gestures 0.1 /tmp/buildd/unity8-7.81.3/obj-x86_64-linux-gnu/plugins > /tmp/buildd/unity8-7.81.3/obj-x86_64-linux-gnu/plugins/Ubuntu/Gestures/UbuntuGestures.qmltypes
QFontDatabase: Cannot find font directory '/usr/lib/x86_64-linux-gnu/fonts' - is Qt installed correctly?
QFontDatabase: Cannot find font directory '/usr/lib/x86_64-linux-gnu/fonts' - is Qt installed correctly?
QFontDatabase: Cannot find font directory '/usr/lib/x86_64-linux-gnu/fonts' - is Qt installed correctly?
QFontDatabase: Cannot find font directory '/usr/lib/x86_64-linux-gnu/fonts' - is Qt installed correctly?
QQmlComponent: Component is not ready
"file:///tmp/buildd/unity8-7.81.3/obj-x86_64-linux-gnu/plugins/typelist.qml:2:1: module "Ubuntu.Gestures" is not installed"

Looks like you need to export QML2_IMPORT_PATH for this.

review: Needs Fixing
70. By Nick Dedekind

Use targets for qmldir. Added dep to qmldir target for qmltypes target

71. By Nick Dedekind

merged with trunk

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> cd /tmp/buildd/unity8-7.81.3/obj-x86_64-linux-gnu/plugins/Ubuntu/Gestures &&
> qmlplugindump -notrelocatable Ubuntu.Gestures 0.1 /tmp/buildd/unity8-7.81.3
> /obj-x86_64-linux-gnu/plugins > /tmp/buildd/unity8-7.81.3/obj-x86_64-linux-
> gnu/plugins/Ubuntu/Gestures/UbuntuGestures.qmltypes
> QFontDatabase: Cannot find font directory '/usr/lib/x86_64-linux-gnu/fonts' -
> is Qt installed correctly?
> QFontDatabase: Cannot find font directory '/usr/lib/x86_64-linux-gnu/fonts' -
> is Qt installed correctly?
> QFontDatabase: Cannot find font directory '/usr/lib/x86_64-linux-gnu/fonts' -
> is Qt installed correctly?
> QFontDatabase: Cannot find font directory '/usr/lib/x86_64-linux-gnu/fonts' -
> is Qt installed correctly?
> QQmlComponent: Component is not ready
> "file:///tmp/buildd/unity8-7.81.3/obj-x86_64-linux-
> gnu/plugins/typelist.qml:2:1: module "Ubuntu.Gestures" is not installed"
>
> Looks like you need to export QML2_IMPORT_PATH for this.

Was a dependency issue. qmltype was being created before there was a qmldir in the build folder. I've changed the plugins to use a custom target for the qmldir (+other files if needed) and added a dep to that target.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
72. By Nick Dedekind

Use macro for exporting a plugin.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Conflicting with latest trunk.

review: Needs Fixing
73. By Nick Dedekind

merged with trunk

74. By Nick Dedekind

fixed up some plugin paths

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

cmake/modules/Plugins.cmake, lines 3-6:

  # add_qml_test(plugin version plugin_export sub_path [DEPENDS target1 [target2 ...]])
  #
  # plugin_export folder where plugin will be found (plugins/modules/imports)
  # TARGETS additional install targets (eg the plugin shared object)

Have to update this documentation.

Other than that, it looks good!

review: Needs Fixing
75. By Nick Dedekind

update Plugins.cmake documentation

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

7 +# add_qml_test(plugin version sub_path [TARGETS target1 [target2 ...]])
8 +#
9 +# TARGETS additional install targets (eg the plugin shared object)
10 +#
11 +# Two targets will be created:
12 +# - PluginName-qmlfiles - Copies the qml files (*.qml, *.js, qmldir) into the shadow build folder.
13 +# - PluginName-qmltypes - Generates the qmltypes file in the shadow build folder.

Almost there. The name of the macro is "export_qmlplugin", not "add_qml_test". :)
Secondly, on line 7 you call the variable "plugin", but on lines 12 and 13 you call it "PluginName". Be consistent to avoid confusing the reader.

review: Needs Fixing
76. By Nick Dedekind

fixed inconsistent documentation.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'cmake/modules/Plugins.cmake'
2--- cmake/modules/Plugins.cmake 1970-01-01 00:00:00 +0000
3+++ cmake/modules/Plugins.cmake 2013-07-08 08:22:27 +0000
4@@ -0,0 +1,48 @@
5+# Creates targets for copying and installing qmlfiles and generating the qmltypes file for a plugin
6+#
7+# export_qmlplugin(plugin version sub_path [TARGETS target1 [target2 ...]])
8+#
9+# TARGETS additional install targets (eg the plugin shared object)
10+#
11+# Two targets will be created:
12+# - plugin-qmlfiles - Copies the qml files (*.qml, *.js, qmldir) into the shadow build folder.
13+# - plugin-qmltypes - Generates the qmltypes file in the shadow build folder.
14+
15+
16+macro(export_qmlplugin PLUGIN VERSION PLUGIN_SUBPATH)
17+ set(multi_value_keywords TARGETS)
18+ cmake_parse_arguments(qmlplugin "" "" "${multi_value_keywords}" ${ARGN})
19+
20+ file(GLOB QMLFILES
21+ *.qml
22+ *.js
23+ qmldir
24+ )
25+
26+ # copy the qmldir file
27+ add_custom_target(${PLUGIN}-qmlfiles ALL
28+ COMMAND cp ${QMLFILES} ${CMAKE_BINARY_DIR}/plugins/${PLUGIN_SUBPATH}
29+ DEPENDS ${QMLFILES}
30+ )
31+
32+ # create the plugin.qmltypes file
33+ add_custom_target(${PLUGIN}-qmltypes ALL
34+ COMMAND qmlplugindump -notrelocatable ${PLUGIN} ${VERSION} ${CMAKE_BINARY_DIR}/plugins > ${CMAKE_BINARY_DIR}/plugins/${PLUGIN_SUBPATH}/plugin.qmltypes
35+ )
36+ add_dependencies(${PLUGIN}-qmltypes ${PLUGIN}-qmlfiles ${qmlplugin_TARGETS})
37+
38+ # install the qmldir file.
39+ install(FILES ${QMLFILES}
40+ DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/${PLUGIN_SUBPATH}
41+ )
42+
43+ # install the qmltypes file.
44+ install(FILES ${CMAKE_BINARY_DIR}/plugins/${PLUGIN_SUBPATH}/plugin.qmltypes
45+ DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/${PLUGIN_SUBPATH}
46+ )
47+
48+ # install the additional targets
49+ install(TARGETS ${qmlplugin_TARGETS}
50+ DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/${PLUGIN_SUBPATH}
51+ )
52+endmacro(export_qmlplugin)
53\ No newline at end of file
54
55=== modified file 'plugins/HudClient/CMakeLists.txt'
56--- plugins/HudClient/CMakeLists.txt 2013-06-26 09:52:31 +0000
57+++ plugins/HudClient/CMakeLists.txt 2013-07-08 08:22:27 +0000
58@@ -1,3 +1,6 @@
59+# export_qmlplugin macro
60+include(Plugins)
61+
62 find_package(Qt5Core REQUIRED)
63 find_package(Qt5Quick REQUIRED)
64 pkg_search_module(DEE dee-1.0 REQUIRED)
65@@ -35,15 +38,5 @@
66
67 qt5_use_modules(HudClientQml Qml)
68
69-# copy qmldir file into build directory for shadow builds
70-file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
71- DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
72- )
73-
74-install(TARGETS HudClientQml
75- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/HudClient
76- )
77-
78-install(FILES qmldir
79- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/HudClient
80- )
81+# export the qmldir and qmltypes files
82+export_qmlplugin(HudClient 0.1 HudClient TARGETS HudClientQml)
83
84=== modified file 'plugins/HudClient/qmldir'
85--- plugins/HudClient/qmldir 2013-06-05 22:03:08 +0000
86+++ plugins/HudClient/qmldir 2013-07-08 08:22:27 +0000
87@@ -1,1 +1,2 @@
88 plugin HudClientQml
89+typeinfo plugin.qmltypes
90
91=== modified file 'plugins/LightDM/CMakeLists.txt'
92--- plugins/LightDM/CMakeLists.txt 2013-07-03 12:11:19 +0000
93+++ plugins/LightDM/CMakeLists.txt 2013-07-08 08:22:27 +0000
94@@ -1,3 +1,6 @@
95+# export_qmlplugin macro
96+include(Plugins)
97+
98 # Dependencies
99 include(FindPkgConfig)
100 pkg_check_modules(LIBUSERMETRICSOUTPUT REQUIRED libusermetricsoutput-1)
101@@ -32,15 +35,5 @@
102
103 qt5_use_modules(LightDM-qml Gui Qml)
104
105-# copy qmldir file into build directory for shadow builds
106-file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
107- DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
108- )
109-
110-install(TARGETS LightDM-qml
111- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/LightDM
112- )
113-
114-install(FILES qmldir
115- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/LightDM
116- )
117+# export the qmldir and qmltypes files
118+export_qmlplugin(LightDM 0.1 LightDM TARGETS LightDM-qml)
119
120=== modified file 'plugins/LightDM/qmldir'
121--- plugins/LightDM/qmldir 2013-06-05 22:03:08 +0000
122+++ plugins/LightDM/qmldir 2013-07-08 08:22:27 +0000
123@@ -1,2 +1,3 @@
124 module LightDM
125 plugin LightDM-qml
126+typeinfo plugin.qmltypes
127
128=== modified file 'plugins/ListViewWithPageHeader/CMakeLists.txt'
129--- plugins/ListViewWithPageHeader/CMakeLists.txt 2013-07-02 17:36:12 +0000
130+++ plugins/ListViewWithPageHeader/CMakeLists.txt 2013-07-08 08:22:27 +0000
131@@ -1,3 +1,6 @@
132+# export_qmlplugin macro
133+include(Plugins)
134+
135 # There's no cmake var for v8 include path :-/
136 # so create one
137 LIST(GET Qt5Core_INCLUDE_DIRS 0 QtCoreDir0)
138@@ -30,15 +33,5 @@
139
140 qt5_use_modules(ListViewWithPageHeader-qml Qml Quick)
141
142-# copy qmldir file into build directory for shadow builds
143-file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
144- DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
145- )
146-
147-install(TARGETS ListViewWithPageHeader-qml
148- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/ListViewWithPageHeader
149- )
150-
151-install(FILES qmldir
152- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/ListViewWithPageHeader
153- )
154+# export the qmldir and qmltypes files
155+export_qmlplugin(ListViewWithPageHeader 0.1 ListViewWithPageHeader TARGETS ListViewWithPageHeader-qml)
156
157=== modified file 'plugins/ListViewWithPageHeader/qmldir'
158--- plugins/ListViewWithPageHeader/qmldir 2013-06-07 13:52:42 +0000
159+++ plugins/ListViewWithPageHeader/qmldir 2013-07-08 08:22:27 +0000
160@@ -1,2 +1,3 @@
161 module ListViewWithPageHeader
162 plugin ListViewWithPageHeader-qml
163+typeinfo plugin.qmltypes
164
165=== modified file 'plugins/Ubuntu/Gestures/CMakeLists.txt'
166--- plugins/Ubuntu/Gestures/CMakeLists.txt 2013-06-26 09:52:31 +0000
167+++ plugins/Ubuntu/Gestures/CMakeLists.txt 2013-07-08 08:22:27 +0000
168@@ -1,3 +1,6 @@
169+# export_qmlplugin macro
170+include(Plugins)
171+
172 set(CMAKE_AUTOMOC ON)
173
174 include(FindPkgConfig)
175@@ -20,16 +23,5 @@
176 # So that Foo.cpp can #include "Foo.moc"
177 include_directories(${CMAKE_CURRENT_BINARY_DIR})
178
179-# copy files into build directory for shadow builds
180-add_custom_target(UbuntuGestureQmlDirFile ALL
181- COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/qmldir" ${CMAKE_CURRENT_BINARY_DIR}
182- DEPENDS qmldir
183-)
184-
185-install(TARGETS UbuntuGestureQml
186- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/Ubuntu/Gestures
187- )
188-
189-install(FILES qmldir
190- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/Ubuntu/Gestures
191- )
192+# export the qmldir and qmltypes files
193+export_qmlplugin(Ubuntu.Gestures 0.1 Ubuntu/Gestures TARGETS UbuntuGestureQml)
194
195=== modified file 'plugins/Ubuntu/Gestures/qmldir'
196--- plugins/Ubuntu/Gestures/qmldir 2013-06-05 22:03:08 +0000
197+++ plugins/Ubuntu/Gestures/qmldir 2013-07-08 08:22:27 +0000
198@@ -1,2 +1,3 @@
199 module Ubuntu.Gestures
200 plugin UbuntuGestureQml
201+typeinfo plugin.qmltypes
202
203=== modified file 'plugins/Unity/CMakeLists.txt'
204--- plugins/Unity/CMakeLists.txt 2013-07-04 10:34:48 +0000
205+++ plugins/Unity/CMakeLists.txt 2013-07-08 08:22:27 +0000
206@@ -1,3 +1,6 @@
207+# export_qmlplugin macro
208+include(Plugins)
209+
210 # Dependencies
211 include(FindPkgConfig)
212 pkg_check_modules(QTDEE REQUIRED libdee-qt5)
213@@ -43,15 +46,5 @@
214
215 qt5_use_modules(Unity-qml Qml)
216
217-# copy qmldir file into build directory for shadow builds
218-file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
219- DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
220- )
221-
222-install(TARGETS Unity-qml
223- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/Unity
224- )
225-
226-install(FILES qmldir
227- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/Unity
228- )
229+# export the qmldir and qmltypes files
230+export_qmlplugin(Unity 0.1 Unity TARGETS Unity-qml)
231
232=== modified file 'plugins/Unity/qmldir'
233--- plugins/Unity/qmldir 2013-06-05 22:03:08 +0000
234+++ plugins/Unity/qmldir 2013-07-08 08:22:27 +0000
235@@ -1,2 +1,3 @@
236 module Unity
237 plugin Unity-qml
238+typeinfo plugin.qmltypes
239
240=== modified file 'plugins/Utils/CMakeLists.txt'
241--- plugins/Utils/CMakeLists.txt 2013-06-26 09:52:31 +0000
242+++ plugins/Utils/CMakeLists.txt 2013-07-08 08:22:27 +0000
243@@ -22,15 +22,5 @@
244
245 qt5_use_modules(Utils-qml Qml Quick)
246
247-# copy qmldir file into build directory for shadow builds
248-file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmldir"
249- DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
250- )
251-
252-install(TARGETS Utils-qml
253- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/Utils
254- )
255-
256-install(FILES qmldir
257- DESTINATION ${SHELL_PRIVATE_LIBDIR}/qml/Utils
258- )
259+# export the qmldir and qmltypes files
260+export_qmlplugin(Utils 0.1 Utils TARGETS Utils-qml)
261
262=== modified file 'plugins/Utils/qmldir'
263--- plugins/Utils/qmldir 2013-06-05 22:03:08 +0000
264+++ plugins/Utils/qmldir 2013-07-08 08:22:27 +0000
265@@ -1,2 +1,3 @@
266 module Utils
267 plugin Utils-qml
268+typeinfo plugin.qmltypes

Subscribers

People subscribed via source and target branches