Merge lp:~sergiusens/ubuntu-calendar-app/cmake into lp:ubuntu-calendar-app

Proposed by Sergio Schvezov
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 184
Merged at revision: 184
Proposed branch: lp:~sergiusens/ubuntu-calendar-app/cmake
Merge into: lp:ubuntu-calendar-app
Diff against target: 267 lines (+131/-34)
14 files modified
CMakeLists.txt (+57/-0)
calendar-app.in (+3/-2)
click/CMakeLists.txt (+8/-0)
click/manifest.json.in (+14/-7)
com.ubuntu.calendar_calendar.desktop.in (+3/-3)
debian/calendar-app-autopilot.install (+2/-1)
debian/calendar-app.install (+2/-5)
debian/changelog (+6/-0)
debian/control (+2/-1)
debian/rules (+0/-13)
po/CMakeLists.txt (+25/-0)
tests/CMakeLists.txt (+1/-0)
tests/autopilot/CMakeLists.txt (+8/-0)
tests/autopilot/calendar_app/tests/__init__.py (+0/-2)
To merge this branch: bzr merge lp:~sergiusens/ubuntu-calendar-app/cmake
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nicholas Skaggs Pending
Ubuntu Calendar Developers Pending
Review via email: mp+202623@code.launchpad.net

Commit message

cmake rules for common building

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: Needs Fixing (continuous-integration)
184. By Sergio Schvezov

Adding cmake to build deps

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
Nicholas Skaggs (nskaggs) wrote :

Looks good.

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-01-22 10:19:10 +0000
4@@ -0,0 +1,57 @@
5+project(com.ubuntu.calendar)
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 calendar)
15+set(DESKTOP_FILE "${PROJECT_NAME}_${APP_NAME}.desktop")
16+set(MAIN_QML calendar.qml)
17+set(ICON calendar64.png)
18+set(AUTOPILOT_DIR calendar_app)
19+set(APP_HARDCODE calendar-app)
20+
21+if(CLICK_MODE)
22+ if(NOT DEFINED BZR_SOURCE)
23+ set(BZR_SOURCE "lp:ubuntu-${APP_HARDCODE}")
24+ message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
25+ endif(NOT DEFINED BZR_SOURCE)
26+ set(CMAKE_INSTALL_PREFIX /)
27+ set(CMAKE_INSTALL_BINDIR /)
28+ set(DATA_DIR /)
29+ set(EXEC "qmlscene %u ${MAIN_QML}")
30+ set(DESKTOP_DIR ${DATA_DIR})
31+else(CLICK_MODE)
32+ set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE})
33+ set(EXEC ${APP_HARDCODE})
34+ set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON})
35+ configure_file(${APP_HARDCODE}.in
36+ ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE})
37+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}
38+ DESTINATION ${CMAKE_INSTALL_BINDIR})
39+ set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
40+endif(CLICK_MODE)
41+
42+file(GLOB_RECURSE I18N_SRC_FILES
43+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
44+ rc/**.qml desktop/**.desktop.in)
45+list(SORT I18N_SRC_FILES)
46+
47+
48+file(GLOB SRC_FILES
49+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
50+ *.qml *.js *.png *.js)
51+install(FILES ${SRC_FILES} DESTINATION ${DATA_DIR})
52+
53+configure_file(${DESKTOP_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
54+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR})
55+
56+# Tests
57+enable_testing()
58+
59+add_subdirectory(click)
60+add_subdirectory(po)
61+add_subdirectory(tests)
62
63=== removed directory 'apparmor'
64=== renamed file 'calendar-app' => 'calendar-app.in' (properties changed: +x to -x)
65--- calendar-app 2013-06-12 15:23:13 +0000
66+++ calendar-app.in 2014-01-22 10:19:10 +0000
67@@ -1,2 +1,3 @@
68-#!/bin/bash
69-qmlscene /usr/share/calendar-app/calendar.qml
70+#!/bin/sh
71+export QT_SELECT=qt5
72+qmlscene @CMAKE_INSTALL_PREFIX@/@DATA_DIR@/@MAIN_QML@
73
74=== added directory 'click'
75=== added file 'click/CMakeLists.txt'
76--- click/CMakeLists.txt 1970-01-01 00:00:00 +0000
77+++ click/CMakeLists.txt 2014-01-22 10:19:10 +0000
78@@ -0,0 +1,8 @@
79+if(CLICK_MODE)
80+ if(NOT BZR_REVNO)
81+ set(BZR_REVNO "latest")
82+ endif(NOT BZR_REVNO)
83+ configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
84+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json
85+ DESTINATION ${CMAKE_INSTALL_PREFIX})
86+endif(CLICK_MODE)
87
88=== renamed file 'apparmor/calendar.json' => 'click/apparmor.json'
89=== renamed file 'manifest.json' => 'click/manifest.json.in'
90--- manifest.json 2013-10-17 06:29:12 +0000
91+++ click/manifest.json.in 2014-01-22 10:19:10 +0000
92@@ -2,14 +2,21 @@
93 "description": "Calendar application for Ubuntu devices",
94 "framework": "ubuntu-sdk-13.10",
95 "hooks": {
96- "calendar": {
97- "apparmor": "apparmor/calendar.json",
98- "desktop": "calendar-app.desktop"
99+ "@APP_NAME@": {
100+ "apparmor": "apparmor.json",
101+ "desktop": "@DESKTOP_FILE@"
102 }
103 },
104- "icon": "calendar64.png",
105+ "icon": "@ICON@",
106 "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>",
107- "name": "com.ubuntu.calendar",
108- "title": "calendar",
109- "version": "0.4"
110+ "name": "@PROJECT_NAME@",
111+ "title": "Calendar",
112+ "version": "0.4.@BZR_REVNO@",
113+ "x-source": {
114+ "vcs-bzr": "@BZR_SOURCE@",
115+ "vcs-bzr-revno": "@BZR_REVNO@"
116+ },
117+ "x-test": {
118+ "autopilot": "@AUTOPILOT_DIR@"
119+ }
120 }
121
122=== renamed file 'calendar-app.desktop' => 'com.ubuntu.calendar_calendar.desktop.in'
123--- calendar-app.desktop 2013-10-16 18:43:17 +0000
124+++ com.ubuntu.calendar_calendar.desktop.in 2014-01-22 10:19:10 +0000
125@@ -2,9 +2,9 @@
126 Version=1.0
127 Type=Application
128 Terminal=false
129-Exec=qmlscene %u /usr/share/calendar-app/calendar.qml
130-Icon=/usr/share/calendar-app/calendar64.png
131+Exec=@EXEC@
132+Icon=@ICON@
133 Name=Calendar
134 X-Ubuntu-Touch=true
135 X-Ubuntu-StageHint=SideStage
136-X-Ubuntu-Gettext-Domain=com.ubuntu.calendar
137+X-Ubuntu-Gettext-Domain=@PROJECT_NAME@
138
139=== modified file 'debian/calendar-app-autopilot.install'
140--- debian/calendar-app-autopilot.install 2013-06-12 15:47:15 +0000
141+++ debian/calendar-app-autopilot.install 2014-01-22 10:19:10 +0000
142@@ -1,1 +1,2 @@
143-tests/autopilot/calendar_app/* usr/lib/python2.7/dist-packages/calendar_app/
144+usr/lib/*/dist-packages/calendar_app/*
145+
146
147=== modified file 'debian/calendar-app.install'
148--- debian/calendar-app.install 2013-06-12 15:23:13 +0000
149+++ debian/calendar-app.install 2014-01-22 10:19:10 +0000
150@@ -1,5 +1,2 @@
151-calendar-app usr/bin/
152-calendar-app.desktop usr/share/applications/
153-*.qml usr/share/calendar-app/
154-*.png usr/share/calendar-app/
155-*.js usr/share/calendar-app/
156+usr/bin/*
157+usr/share/*
158
159=== modified file 'debian/changelog'
160--- debian/changelog 2013-06-12 15:32:14 +0000
161+++ debian/changelog 2014-01-22 10:19:10 +0000
162@@ -1,3 +1,9 @@
163+calendar-app (0.4ubuntu1) UNRELEASED; urgency=medium
164+
165+ * Adding cmake
166+
167+ -- Sergio Schvezov <sergio.schvezov@canonical.com> Sat, 18 Jan 2014 17:05:03 -0300
168+
169 calendar-app (0.4) raring; urgency=low
170
171 * Renamed package
172
173=== modified file 'debian/control'
174--- debian/control 2013-10-25 04:07:59 +0000
175+++ debian/control 2014-01-22 10:19:10 +0000
176@@ -1,7 +1,8 @@
177 Source: calendar-app
178 Priority: extra
179 Maintainer: Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>
180-Build-Depends: debhelper (>= 9),
181+Build-Depends: cmake,
182+ debhelper (>= 9),
183 qtdeclarative5-dev-tools,
184 qt5-default,
185 qtdeclarative5-qtquick2-plugin,
186
187=== modified file 'debian/rules'
188--- debian/rules 2013-10-16 18:43:17 +0000
189+++ debian/rules 2014-01-22 10:19:10 +0000
190@@ -9,16 +9,3 @@
191
192 override_dh_auto_test:
193 QT_QPA_PLATFORM=minimal qmltestrunner -input tests/unittests/
194-
195-override_dh_install:
196- dh_install --fail-missing
197- appname=com.ubuntu.calendar; \
198- for pofile in $(shell find ./po -name "*.po"); do \
199- pofilename="$${pofile##*/}"; \
200- langcode="$${pofilename%.*}"; \
201- localedir="usr/share/locale/$$langcode/LC_MESSAGES"; \
202- mofile="$$appname.mo"; \
203- msgfmt -o $$mofile $$pofile; \
204- dh_install $$mofile $$localedir; \
205- rm -f $$mofile; \
206- done
207
208=== added file 'po/CMakeLists.txt'
209--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
210+++ po/CMakeLists.txt 2014-01-22 10:19:10 +0000
211@@ -0,0 +1,25 @@
212+include(FindGettext)
213+find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
214+
215+set(DOMAIN ${PROJECT_NAME})
216+set(POT_FILE ${DOMAIN}.pot)
217+file(GLOB PO_FILES *.po)
218+
219+add_custom_target(${POT_FILE}
220+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
221+ -D ${CMAKE_SOURCE_DIR}
222+ --from-code=UTF-8
223+ --c++ --qt --add-comments=TRANSLATORS
224+ --keyword=tr --keyword=tr:1,2
225+ --package-name='${PROJECT}'
226+ --copyright-holder='Canonical Ltd.'
227+ ${I18N_SRC_FILES})
228+
229+foreach(PO_FILE ${PO_FILES})
230+ get_filename_component(LANG ${PO_FILE} NAME_WE)
231+ gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
232+ set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES)
233+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
234+ DESTINATION ${INSTALL_DIR}
235+ RENAME ${DOMAIN}.mo)
236+endforeach(PO_FILE)
237
238=== added file 'tests/CMakeLists.txt'
239--- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
240+++ tests/CMakeLists.txt 2014-01-22 10:19:10 +0000
241@@ -0,0 +1,1 @@
242+add_subdirectory(autopilot)
243
244=== added file 'tests/autopilot/CMakeLists.txt'
245--- tests/autopilot/CMakeLists.txt 1970-01-01 00:00:00 +0000
246+++ tests/autopilot/CMakeLists.txt 2014-01-22 10:19:10 +0000
247@@ -0,0 +1,8 @@
248+if(INSTALL_TESTS)
249+execute_process(COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
250+ OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
251+
252+install(DIRECTORY ${AUTOPILOT_DIR}
253+ DESTINATION ${PYTHON_PACKAGE_DIR}
254+ )
255+endif(INSTALL_TESTS)
256
257=== modified file 'tests/autopilot/calendar_app/tests/__init__.py'
258--- tests/autopilot/calendar_app/tests/__init__.py 2013-11-15 16:30:52 +0000
259+++ tests/autopilot/calendar_app/tests/__init__.py 2014-01-22 10:19:10 +0000
260@@ -80,8 +80,6 @@
261 self.app = self.launch_test_application(
262 "qmlscene",
263 self.installed_location,
264- "--desktop_file_hint=/usr/share/applications/"
265- "calendar-app.desktop",
266 app_type='qt',
267 emulator_base=toolkit_emulators.UbuntuUIToolkitEmulatorBase)
268

Subscribers

People subscribed via source and target branches

to status/vote changes: