Merge lp:~nskaggs/ubuntu-weather-app/add-cmake into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Nicholas Skaggs
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 189
Merged at revision: 193
Proposed branch: lp:~nskaggs/ubuntu-weather-app/add-cmake
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 307 lines (+138/-51)
14 files modified
CMakeLists.txt (+64/-0)
click/CMakeLists.txt (+8/-0)
click/manifest.json.in (+14/-6)
com.ubuntu.weather_weather.desktop.in (+3/-3)
debian/control (+10/-9)
debian/rules (+0/-14)
debian/ubuntu-weather-app-autopilot.install (+1/-1)
debian/ubuntu-weather-app.install (+2/-7)
po/CMakeLists.txt (+25/-0)
tests/CMakeLists.txt (+1/-0)
tests/autopilot/CMakeLists.txt (+8/-0)
tests/autopilot/install_autopilot.sh (+0/-8)
tests/autopilot/ubuntu_weather_app/tests/__init__.py (+0/-2)
ubuntu-weather-app.in (+2/-1)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-weather-app/add-cmake
Reviewer Review Type Date Requested Status
David Planella Needs Fixing
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+204349@code.launchpad.net

Commit message

Add cmake build

Description of the change

Add cmake build

To post a comment you must log in.
184. By Nicholas Skaggs

fix mispelling

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
185. By Nicholas Skaggs

fix build

186. By Nicholas Skaggs

tweak cmake app name

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
187. By Nicholas Skaggs

tweak cmake

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
188. By Nicholas Skaggs

fix main qml in cmake

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
189. By Nicholas Skaggs

add install dirs, clean deb control

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

This slipped off my radar, and I've just noticed it now:

45 +file(GLOB_RECURSE I18N_SRC_FILES
46 + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
47 + rc/**.qml desktop/**.desktop.in)
48 +list(SORT I18N_SRC_FILES)

This looks like a boilerplate rule, which hasn't been adapted to the current code. The paths need to be fixed and add .js files to it. Out of interest, what are the double asterisks for?

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'CMakeLists.txt'
2--- CMakeLists.txt 1970-01-01 00:00:00 +0000
3+++ CMakeLists.txt 2014-02-13 01:10:17 +0000
4@@ -0,0 +1,64 @@
5+project(com.ubuntu.weather)
6+cmake_minimum_required(VERSION 2.8.9)
7+
8+# Standard install paths
9+include(GNUInstallDirs)
10+
11+option(INSTALL_TESTS "Install the tests on make install" on)
12+option(CLICK_MODE "Installs to a contained location" off)
13+
14+set(APP_NAME weather)
15+set(DESKTOP_FILE "${PROJECT_NAME}_${APP_NAME}.desktop")
16+set(URLS_FILE "${PROJECT_NAME}_${APP_NAME}.url-dispatcher")
17+set(APP_HARDCODE ubuntu-weather-app)
18+set(MAIN_QML ubuntu-weather-app.qml)
19+set(ICON weather64.png)
20+set(AUTOPILOT_DIR ubuntu_weather_app)
21+
22+if(CLICK_MODE)
23+ if(NOT DEFINED BZR_SOURCE)
24+ set(BZR_SOURCE "lp:${APP_HARDCODE}")
25+ message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
26+ endif(NOT DEFINED BZR_SOURCE)
27+ set(CMAKE_INSTALL_PREFIX /)
28+ set(CMAKE_INSTALL_BINDIR /)
29+ set(DATA_DIR /)
30+ set(EXEC "qmlscene ${MAIN_QML}")
31+ set(DESKTOP_DIR ${DATA_DIR})
32+ set(URLS_DIR ${DATA_DIR})
33+else(CLICK_MODE)
34+ set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE})
35+ set(EXEC ${APP_HARDCODE})
36+ set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON})
37+ configure_file(${APP_HARDCODE}.in
38+ ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE})
39+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}
40+ DESTINATION ${CMAKE_INSTALL_BINDIR})
41+ set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
42+ set(URLS_DIR ${CMAKE_INSTALL_DATADIR}/url-dispatcher/urls)
43+endif(CLICK_MODE)
44+
45+file(GLOB_RECURSE I18N_SRC_FILES
46+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
47+ rc/**.qml desktop/**.desktop.in)
48+list(SORT I18N_SRC_FILES)
49+
50+
51+file(GLOB SRC_FILES
52+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
53+ *.qml *.js *.png *.js)
54+install(DIRECTORY components resources DESTINATION ${DATA_DIR})
55+install(FILES ${MAIN_QML} DESTINATION ${DATA_DIR})
56+
57+configure_file(${DESKTOP_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
58+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}
59+ DESTINATION ${DESKTOP_DIR})
60+
61+install(FILES ${URLS_FILE} DESTINATION ${URLS_DIR})
62+
63+# Tests
64+enable_testing()
65+
66+add_subdirectory(click)
67+add_subdirectory(po)
68+add_subdirectory(tests)
69
70=== removed directory 'apparmor'
71=== added directory 'click'
72=== added file 'click/CMakeLists.txt'
73--- click/CMakeLists.txt 1970-01-01 00:00:00 +0000
74+++ click/CMakeLists.txt 2014-02-13 01:10:17 +0000
75@@ -0,0 +1,8 @@
76+if(CLICK_MODE)
77+ if(NOT BZR_REVNO)
78+ set(BZR_REVNO "latest")
79+ endif(NOT BZR_REVNO)
80+ configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
81+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json
82+ DESTINATION ${CMAKE_INSTALL_PREFIX})
83+endif(CLICK_MODE)
84
85=== renamed file 'apparmor/weather.json' => 'click/apparmor.json'
86=== renamed file 'manifest.json' => 'click/manifest.json.in'
87--- manifest.json 2014-01-28 05:04:43 +0000
88+++ click/manifest.json.in 2014-02-13 01:10:17 +0000
89@@ -2,14 +2,22 @@
90 "description": "Weather application",
91 "framework": "ubuntu-sdk-13.10",
92 "hooks": {
93- "weather": {
94- "apparmor": "apparmor/weather.json",
95- "desktop": "ubuntu-weather-app.desktop"
96+ "@APP_NAME@": {
97+ "apparmor": "apparmor.json",
98+ "desktop": "@DESKTOP_FILE@",
99+ "urls": "@URLS_FILE@"
100 }
101 },
102- "icon": "weather64.png",
103+ "icon": "@ICON@",
104 "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>",
105- "name": "com.ubuntu.weather",
106+ "name": "@PROJECT_NAME@",
107 "title": "weather",
108- "version": "1.0"
109+ "version": "1.0.@BZR_REVNO@",
110+ "x-source": {
111+ "vcs-bzr": "@BZR_SOURCE@",
112+ "vcs-bzr-revno": "@BZR_REVNO@"
113+ },
114+ "x-test": {
115+ "autopilot": "@AUTOPILOT_DIR@"
116+ }
117 }
118
119=== renamed file 'ubuntu-weather-app.desktop' => 'com.ubuntu.weather_weather.desktop.in'
120--- ubuntu-weather-app.desktop 2013-10-10 20:46:51 +0000
121+++ com.ubuntu.weather_weather.desktop.in 2014-02-13 01:10:17 +0000
122@@ -2,9 +2,9 @@
123 Version=1.0
124 Type=Application
125 Terminal=false
126-Exec=qmlscene /usr/share/ubuntu-weather-app/ubuntu-weather-app.qml
127-Icon=/usr/share/ubuntu-weather-app/weather64.png
128+Exec=@EXEC@
129+Icon=@ICON@
130 Name=Weather
131 X-Ubuntu-Touch=true
132 X-Ubuntu-StageHint=SideStage
133-X-Ubuntu-Gettext-Domain=com.ubuntu.weather
134+X-Ubuntu-Gettext-Domain=@PROJECT_NAME@
135
136=== added file 'com.ubuntu.weather_weather.url-dispatcher'
137=== modified file 'debian/control'
138--- debian/control 2013-11-05 20:31:33 +0000
139+++ debian/control 2014-02-13 01:10:17 +0000
140@@ -1,7 +1,8 @@
141 Source: ubuntu-weather-app
142 Priority: extra
143 Maintainer: Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>
144-Build-Depends: debhelper (>= 9),
145+Build-Depends: cmake,
146+ debhelper (>= 9),
147 python,
148 Standards-Version: 3.9.4
149 Section: misc
150@@ -11,22 +12,22 @@
151 Package: ubuntu-weather-app
152 Section: misc
153 Architecture: all
154-Depends: ${misc:Depends},
155- qmlscene,
156+Depends: qmlscene,
157+ qtdeclarative5-localstorage-plugin,
158+ qtdeclarative5-qtquick2-plugin,
159 qtdeclarative5-ubuntu-ui-toolkit-plugin | qt-components-ubuntu,
160- qtdeclarative5-localstorage-plugin,
161- qtdeclarative5-qtquick2-plugin
162+ ${misc:Depends},
163 Description: Weather application
164 Core Weather application
165
166 Package: ubuntu-weather-app-autopilot
167 Architecture: all
168-Depends: ${misc:Depends},
169- python2.7,
170- ubuntu-weather-app (= ${source:Version}),
171- libautopilot-qt (>= 1.4),
172+Depends: libautopilot-qt (>= 1.4),
173 libqt5test5,
174 libqt5widgets5,
175+ python2.7,
176 ubuntu-ui-toolkit-autopilot,
177+ ubuntu-weather-app (= ${source:Version}),
178+ ${misc:Depends},
179 Description: Test package for the weather app
180 Autopilot tests for the weather app package
181
182=== modified file 'debian/rules'
183--- debian/rules 2013-10-10 20:47:33 +0000
184+++ debian/rules 2014-02-13 01:10:17 +0000
185@@ -6,17 +6,3 @@
186
187 %:
188 dh $@
189-
190-override_dh_install:
191- tests/autopilot/install_autopilot.sh $(CURDIR)
192- dh_install --fail-missing
193- appname=com.ubuntu.weather; \
194- debname=ubuntu-weather-app; \
195- for pofile in $(shell find ./po -name "*.po"); do \
196- pofilename="$${pofile##*/}"; \
197- langcode="$${pofilename%.*}"; \
198- localedir="debian/$$debname/usr/share/locale/$$langcode/LC_MESSAGES"; \
199- mkdir -p $$localedir; \
200- mofile="$$localedir/$$appname.mo"; \
201- msgfmt -o $$mofile $$pofile; \
202- done
203
204=== modified file 'debian/ubuntu-weather-app-autopilot.install'
205--- debian/ubuntu-weather-app-autopilot.install 2013-04-22 13:59:51 +0000
206+++ debian/ubuntu-weather-app-autopilot.install 2014-02-13 01:10:17 +0000
207@@ -1,1 +1,1 @@
208-/usr/lib/python*/dist-packages/ubuntu_weather_app/
209+usr/lib/*/dist-packages/ubuntu_weather_app/*
210
211=== modified file 'debian/ubuntu-weather-app.install'
212--- debian/ubuntu-weather-app.install 2013-04-11 20:37:30 +0000
213+++ debian/ubuntu-weather-app.install 2014-02-13 01:10:17 +0000
214@@ -1,7 +1,2 @@
215-ubuntu-weather-app usr/bin/
216-ubuntu-weather-app.desktop usr/share/applications/
217-*.qml usr/share/ubuntu-weather-app/
218-*.png usr/share/ubuntu-weather-app/
219-components usr/share/ubuntu-weather-app/
220-resources usr/share/ubuntu-weather-app/
221-
222+usr/bin/*
223+usr/share/*
224
225=== added file 'po/CMakeLists.txt'
226--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
227+++ po/CMakeLists.txt 2014-02-13 01:10:17 +0000
228@@ -0,0 +1,25 @@
229+include(FindGettext)
230+find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
231+
232+set(DOMAIN ${PROJECT_NAME})
233+set(POT_FILE ${DOMAIN}.pot)
234+file(GLOB PO_FILES *.po)
235+
236+add_custom_target(${POT_FILE}
237+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
238+ -D ${CMAKE_SOURCE_DIR}
239+ --from-code=UTF-8
240+ --c++ --qt --add-comments=TRANSLATORS
241+ --keyword=tr --keyword=tr:1,2
242+ --package-name='${PROJECT}'
243+ --copyright-holder='Canonical Ltd.'
244+ ${I18N_SRC_FILES})
245+
246+foreach(PO_FILE ${PO_FILES})
247+ get_filename_component(LANG ${PO_FILE} NAME_WE)
248+ gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
249+ set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES)
250+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
251+ DESTINATION ${INSTALL_DIR}
252+ RENAME ${DOMAIN}.mo)
253+endforeach(PO_FILE)
254
255=== added file 'tests/CMakeLists.txt'
256--- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
257+++ tests/CMakeLists.txt 2014-02-13 01:10:17 +0000
258@@ -0,0 +1,1 @@
259+add_subdirectory(autopilot)
260
261=== added file 'tests/autopilot/CMakeLists.txt'
262--- tests/autopilot/CMakeLists.txt 1970-01-01 00:00:00 +0000
263+++ tests/autopilot/CMakeLists.txt 2014-02-13 01:10:17 +0000
264@@ -0,0 +1,8 @@
265+if(INSTALL_TESTS)
266+execute_process(COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
267+ OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
268+
269+install(DIRECTORY ${AUTOPILOT_DIR}
270+ DESTINATION ${PYTHON_PACKAGE_DIR}
271+ )
272+endif(INSTALL_TESTS)
273
274=== removed file 'tests/autopilot/install_autopilot.sh'
275--- tests/autopilot/install_autopilot.sh 2013-04-05 08:12:09 +0000
276+++ tests/autopilot/install_autopilot.sh 1970-01-01 00:00:00 +0000
277@@ -1,8 +0,0 @@
278-#!/bin/bash
279-
280-PYDIR=`python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()'`
281-CURDIR=$1
282-
283-mkdir -p ${CURDIR}/debian/tmp${PYDIR}
284-cp -r tests/autopilot/ubuntu_weather_app ${CURDIR}/debian/tmp${PYDIR}
285-
286
287=== modified file 'tests/autopilot/ubuntu_weather_app/tests/__init__.py'
288--- tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-12-17 18:57:25 +0000
289+++ tests/autopilot/ubuntu_weather_app/tests/__init__.py 2014-02-13 01:10:17 +0000
290@@ -77,8 +77,6 @@
291 self.app = self.launch_test_application(
292 self.qmlscene(),
293 self.installed_location,
294- "--desktop_file_hint=/usr/share/applications/"
295- "ubuntu-weather-app.desktop",
296 app_type='qt',
297 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
298
299
300=== renamed file 'ubuntu-weather-app' => 'ubuntu-weather-app.in'
301--- ubuntu-weather-app 2013-04-11 20:37:30 +0000
302+++ ubuntu-weather-app.in 2014-02-13 01:10:17 +0000
303@@ -1,2 +1,3 @@
304 #!/bin/bash
305-qmlscene /usr/share/ubuntu-weather-app/ubuntu-weather-app.qml
306+export QT_SELECT=qt5
307+qmlscene @CMAKE_INSTALL_PREFIX@/@DATA_DIR@/@MAIN_QML@

Subscribers

People subscribed via source and target branches