Merge lp:~sergiusens/reminders-app/cmake_common into lp:reminders-app

Proposed by Sergio Schvezov
Status: Merged
Approved by: Michael Zanetti
Approved revision: 29
Merged at revision: 29
Proposed branch: lp:~sergiusens/reminders-app/cmake_common
Merge into: lp:reminders-app
Diff against target: 278 lines (+137/-32)
14 files modified
CMakeLists.txt (+63/-3)
click/CMakeLists.txt (+8/-0)
click/manifest.json.in (+14/-7)
com.ubuntu.reminders_reminders.desktop.in (+3/-3)
debian/changelog (+6/-0)
debian/reminders-app-autopilot.install (+1/-1)
debian/reminders-app.install (+3/-5)
debian/rules (+0/-10)
po/CMakeLists.txt (+25/-0)
reminders-app.in (+3/-2)
src/app/CMakeLists.txt (+2/-0)
src/plugin/Evernote/CMakeLists.txt (+0/-1)
tests/CMakeLists.txt (+1/-0)
tests/autopilot/CMakeLists.txt (+8/-0)
To merge this branch: bzr merge lp:~sergiusens/reminders-app/cmake_common
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Needs Fixing
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+202215@code.launchpad.net

Commit message

Adding common cmake targets

Description of the change

You can use click-buddy[1] on the target arch to get a package built.

[1] https://code.launchpad.net/~sergiusens/phablet-tools/click-buddy/+merge/202178

To post a comment you must log in.
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
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) :
review: Approve
Revision history for this message
Michael Zanetti (mzanetti) wrote :

This breaks lots of stuff. And only partially renames reminders-app to reminders.

Why don't you use the existing .desktop filename?

I don't see any advantage in generating all that stuff with cmake.

review: Disapprove
Revision history for this message
Michael Zanetti (mzanetti) wrote :

ah ok... now I see why the desktop file is generated. still, please complete the renaming or leave stuff to reminders-app

review: Needs Fixing
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

> This breaks lots of stuff. And only partially renames reminders-app to
> reminders.

Aside from applicationName, where else is it missing?

> Why don't you use the existing .desktop filename?
>
> I don't see any advantage in generating all that stuff with cmake.

The advantage is that we don't have hard coded strings all over the place

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

> ah ok... now I see why the desktop file is generated. still, please complete
> the renaming or leave stuff to reminders-app

This is a soft blocker for the store, at least under the com.ubuntu namespace where all the -app's have been stripped.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-12-18 00:30:17 +0000
3+++ CMakeLists.txt 2014-01-19 14:04:19 +0000
4@@ -1,10 +1,70 @@
5+project(com.ubuntu.reminders C CXX)
6 cmake_minimum_required(VERSION 2.8.9)
7
8-project(reminders-app C CXX)
9-
10 set(CMAKE_AUTOMOC ON)
11-
12 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra -fPIC")
13
14+# Standard install paths
15+include(GNUInstallDirs)
16+
17+# components PATH
18+execute_process(
19+ COMMAND qmake -query QT_INSTALL_QML
20+ OUTPUT_VARIABLE QT_IMPORTS_DIR
21+ OUTPUT_STRIP_TRAILING_WHITESPACE
22+)
23+
24+option(INSTALL_TESTS "Install the tests on make install" on)
25+option(CLICK_MODE "Installs to a contained location" off)
26+
27+set(APP_NAME reminders)
28+set(DESKTOP_FILE "${PROJECT_NAME}_${APP_NAME}.desktop")
29+set(ICON ${APP_NAME}.png)
30+set(AUTOPILOT_DIR reminders_app)
31+set(APP_HARDCODE reminders-app)
32+set(MAIN_QML ${APP_HARDCODE}.qml)
33+
34+if(CLICK_MODE)
35+ if(NOT DEFINED BZR_SOURCE)
36+ set(BZR_SOURCE "lp:${APP_HARDCODE}")
37+ message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
38+ endif(NOT DEFINED BZR_SOURCE)
39+ STRING(REPLACE "/usr/" "/" QT_IMPORTS_DIR ${QT_IMPORTS_DIR})
40+ set(CMAKE_INSTALL_PREFIX /)
41+ set(CMAKE_INSTALL_BINDIR /)
42+ set(DATA_DIR /)
43+ set(EXEC "qmlscene $@ -I .${QT_IMPORTS_DIR} qml/${MAIN_QML}")
44+ set(DESKTOP_DIR ${DATA_DIR})
45+else(CLICK_MODE)
46+ set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE})
47+ configure_file(${APP_HARDCODE}.in
48+ ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE})
49+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}
50+ DESTINATION ${CMAKE_INSTALL_BINDIR})
51+ set(EXEC "qmlscene $@ ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/qml/${MAIN_QML}")
52+ set(ICON "${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON}")
53+ set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
54+endif(CLICK_MODE)
55+
56+file(GLOB_RECURSE I18N_SRC_FILES
57+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
58+ rc/**.qml desktop/**.desktop.in)
59+list(SORT I18N_SRC_FILES)
60+
61+
62+file(GLOB SRC_FILES
63+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
64+ *.qml *.js *.png *.js)
65+install(FILES ${SRC_FILES} DESTINATION ${DATA_DIR})
66+
67+configure_file(${DESKTOP_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
68+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR})
69+
70+# Tests
71+enable_testing()
72+
73+add_subdirectory(click)
74+add_subdirectory(po)
75+add_subdirectory(tests)
76 add_subdirectory(3rdParty)
77 add_subdirectory(src)
78
79=== removed directory 'apparmor'
80=== added directory 'click'
81=== added file 'click/CMakeLists.txt'
82--- click/CMakeLists.txt 1970-01-01 00:00:00 +0000
83+++ click/CMakeLists.txt 2014-01-19 14:04:19 +0000
84@@ -0,0 +1,8 @@
85+if(CLICK_MODE)
86+ if(NOT BZR_REVNO)
87+ set(BZR_REVNO "latest")
88+ endif(NOT BZR_REVNO)
89+ configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
90+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json
91+ DESTINATION ${CMAKE_INSTALL_PREFIX})
92+endif(CLICK_MODE)
93
94=== renamed file 'apparmor/reminders-app.json' => 'click/apparmor.json'
95=== renamed file 'manifest.json' => 'click/manifest.json.in'
96--- manifest.json 2013-11-22 21:43:05 +0000
97+++ click/manifest.json.in 2014-01-19 14:04:19 +0000
98@@ -1,15 +1,22 @@
99 {
100- "description": "description of reminders-app",
101+ "description": "Ubuntu Reminders app, powered by Evernote",
102 "framework": "ubuntu-sdk-13.10",
103 "architecture": "armhf",
104 "hooks": {
105- "reminders-app": {
106- "apparmor": "reminders-app.json",
107- "desktop": "reminders-app.desktop"
108+ "@APP_NAME@": {
109+ "apparmor": "apparmor.json",
110+ "desktop": "@DESKTOP_FILE@"
111 }
112 },
113 "maintainer": "Ubuntu Reminders app developers <ubuntu-phone@lists.launchpad.net>",
114- "name": "com.ubuntu.reminders-app",
115- "title": "reminders-app",
116- "version": "0.1"
117+ "name": "@PROJECT_NAME@",
118+ "title": "Reminders",
119+ "version": "0.1.@BZR_REVNO@",
120+ "x-source": {
121+ "vcs-bzr": "@BZR_SOURCE@",
122+ "vcs-bzr-revno": "@BZR_REVNO@"
123+ },
124+ "x-test": {
125+ "autopilot": "@AUTOPILOT_DIR@"
126+ }
127 }
128
129=== renamed file 'reminders-app.desktop' => 'com.ubuntu.reminders_reminders.desktop.in'
130--- reminders-app.desktop 2014-01-15 15:26:46 +0000
131+++ com.ubuntu.reminders_reminders.desktop.in 2014-01-19 14:04:19 +0000
132@@ -1,9 +1,9 @@
133 [Desktop Entry]
134 Name=Reminders
135 Comment=Ubuntu Reminders app, powered by Evernote
136-Exec=qmlscene $@ -I . qml/reminders-app.qml
137-Icon=reminders-app.png
138+Exec=@EXEC@
139+Icon=@ICON@
140 Terminal=false
141 Type=Application
142 X-Ubuntu-Touch=true
143-X-Ubuntu-Gettext-Domain=com.ubuntu.reminders-app
144+X-Ubuntu-Gettext-Domain=@PROJECT_NAME@
145
146=== modified file 'debian/changelog'
147--- debian/changelog 2013-11-26 11:20:25 +0000
148+++ debian/changelog 2014-01-19 14:04:19 +0000
149@@ -1,3 +1,9 @@
150+reminders-app (0.2ubuntu1) UNRELEASED; urgency=medium
151+
152+ * Adding common cmake.
153+
154+ -- Sergio Schvezov <sergio.schvezov@canonical.com> Sun, 19 Jan 2014 10:30:23 -0300
155+
156 reminders-app (0.2) saucy; urgency=low
157
158 * Added authentication plugin dependencies, bumped package version
159
160=== modified file 'debian/reminders-app-autopilot.install'
161--- debian/reminders-app-autopilot.install 2013-11-20 22:38:24 +0000
162+++ debian/reminders-app-autopilot.install 2014-01-19 14:04:19 +0000
163@@ -1,1 +1,1 @@
164-tests/autopilot/reminders_app/* usr/lib/python2.7/dist-packages/reminders_app/
165+usr/lib/*/dist-packages/reminders_app/
166
167=== modified file 'debian/reminders-app.install'
168--- debian/reminders-app.install 2013-11-22 19:10:05 +0000
169+++ debian/reminders-app.install 2014-01-19 14:04:19 +0000
170@@ -1,5 +1,3 @@
171-reminders-app usr/bin/
172-reminders-app.desktop usr/share/applications/
173-src/app/qml/ usr/share/reminders-app/
174-*.png usr/share/reminders-app/
175-usr/lib/*/qt5/qml/Evernote/
176+usr/bin/*
177+usr/lib/*/qt5/*
178+usr/share/*
179
180=== modified file 'debian/rules'
181--- debian/rules 2013-11-20 22:38:24 +0000
182+++ debian/rules 2014-01-19 14:04:19 +0000
183@@ -9,13 +9,3 @@
184
185 override_dh_install:
186 dh_install --fail-missing
187- appname=com.ubuntu.reminders-app; \
188- debname=reminders-app; \
189- for pofile in $(shell find ./po -name "*.po"); do \
190- pofilename="$${pofile##*/}"; \
191- langcode="$${pofilename%.*}"; \
192- localedir="debian/$$debname/usr/share/locale/$$langcode/LC_MESSAGES"; \
193- mkdir -p $$localedir; \
194- mofile="$$localedir/$$appname.mo"; \
195- msgfmt -o $$mofile $$pofile; \
196- done
197
198=== added file 'po/CMakeLists.txt'
199--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
200+++ po/CMakeLists.txt 2014-01-19 14:04:19 +0000
201@@ -0,0 +1,25 @@
202+include(FindGettext)
203+find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
204+
205+set(DOMAIN ${PROJECT_NAME})
206+set(POT_FILE ${DOMAIN}.pot)
207+file(GLOB PO_FILES *.po)
208+
209+add_custom_target(${POT_FILE}
210+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
211+ -D ${CMAKE_SOURCE_DIR}
212+ --from-code=UTF-8
213+ --c++ --qt --add-comments=TRANSLATORS
214+ --keyword=tr --keyword=tr:1,2
215+ --package-name='${PROJECT}'
216+ --copyright-holder='Canonical Ltd.'
217+ ${I18N_SRC_FILES})
218+
219+foreach(PO_FILE ${PO_FILES})
220+ get_filename_component(LANG ${PO_FILE} NAME_WE)
221+ gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
222+ set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES)
223+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
224+ DESTINATION ${INSTALL_DIR}
225+ RENAME ${DOMAIN}.mo)
226+endforeach(PO_FILE)
227
228=== renamed file 'reminders-app' => 'reminders-app.in'
229--- reminders-app 2013-11-22 19:10:05 +0000
230+++ reminders-app.in 2014-01-19 14:04:19 +0000
231@@ -1,2 +1,3 @@
232-#!/bin/bash
233-qmlscene /usr/share/reminders-app/qml/reminders-app.qml
234+#!/bin/sh
235+export QT_SELECT=qt5
236+qmlscene @CMAKE_INSTALL_PREFIX@/@DATA_DIR@/@MAIN_QML@
237
238=== renamed file 'reminders-app.png' => 'reminders.png'
239=== modified file 'src/app/CMakeLists.txt'
240--- src/app/CMakeLists.txt 2013-12-18 00:30:17 +0000
241+++ src/app/CMakeLists.txt 2014-01-19 14:04:19 +0000
242@@ -13,3 +13,5 @@
243 COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/qml ${CMAKE_CURRENT_BINARY_DIR}
244 DEPENDS ${QMLFILES}
245 )
246+
247+install(DIRECTORY qml DESTINATION ${DATA_DIR})
248
249=== modified file 'src/plugin/Evernote/CMakeLists.txt'
250--- src/plugin/Evernote/CMakeLists.txt 2013-12-18 23:48:12 +0000
251+++ src/plugin/Evernote/CMakeLists.txt 2014-01-19 14:04:19 +0000
252@@ -47,7 +47,6 @@
253 )
254
255 # Install plugin file
256-exec_program(qmake ARGS "-query QT_INSTALL_QML" OUTPUT_VARIABLE QT_IMPORTS_DIR)
257 install(TARGETS evernoteplugin DESTINATION ${QT_IMPORTS_DIR}/Evernote/)
258 install(FILES qmldir DESTINATION ${QT_IMPORTS_DIR}/Evernote/)
259
260
261=== added file 'tests/CMakeLists.txt'
262--- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
263+++ tests/CMakeLists.txt 2014-01-19 14:04:19 +0000
264@@ -0,0 +1,1 @@
265+add_subdirectory(autopilot)
266
267=== added file 'tests/autopilot/CMakeLists.txt'
268--- tests/autopilot/CMakeLists.txt 1970-01-01 00:00:00 +0000
269+++ tests/autopilot/CMakeLists.txt 2014-01-19 14:04:19 +0000
270@@ -0,0 +1,8 @@
271+if(INSTALL_TESTS)
272+execute_process(COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
273+ OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
274+
275+install(DIRECTORY ${AUTOPILOT_DIR}
276+ DESTINATION ${PYTHON_PACKAGE_DIR}
277+ )
278+endif(INSTALL_TESTS)

Subscribers

People subscribed via source and target branches