Merge lp:~vthompson/ubuntu-weather-app/build-reboot into lp:ubuntu-weather-app
- build-reboot
- Merge into reboot
Status: | Merged |
---|---|
Approved by: | Martin Borho |
Approved revision: | 5 |
Merged at revision: | 2 |
Proposed branch: | lp:~vthompson/ubuntu-weather-app/build-reboot |
Merge into: | lp:ubuntu-weather-app |
Diff against target: |
499 lines (+255/-117) 14 files modified
CMakeLists.txt (+75/-62) app/CMakeLists.txt (+15/-0) app/components/CMakeLists.txt (+5/-0) app/ubuntu-weather-app.qml (+49/-0) backend/CMakeLists.txt (+29/-0) click/CMakeLists.txt (+0/-15) manifest.json.in (+3/-3) po/CMakeLists.txt (+33/-0) po/com.ubuntu.weather.pot (+32/-0) tests/CMakeLists.txt (+3/-0) tests/autopilot/CMakeLists.txt (+8/-0) ubuntu-weather-app.apparmor (+3/-2) ubuntu-weather-app.in (+0/-3) ubuntu-weather-app.qmlproject (+0/-32) |
To merge this branch: | bzr merge lp:~vthompson/ubuntu-weather-app/build-reboot |
Related bugs: | |
Related blueprints: |
Weather App Reboot
(High)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Borho | Approve | ||
Nekhelesh Ramananthan (community) | Approve | ||
Review via email: mp+247372@code.launchpad.net |
This proposal supersedes a proposal from 2015-01-23.
Commit message
* Fill out file structure to allow CMake to build, using the file structure typical in QtCreator.
Description of the change
* Fill out file structure to allow CMake to build, assuming old file layout.
Let's decide how we want to organize the code for our components/
components/
resources/
plugins/
po/
tests/
I'm A-OK with that if we want to keep things that way, otherwise I'd suggest the following (which is how QtCreator lays out a C++/QML application):
app/components/
app/graphics/
app/tests/
apps/ui/
backend/modules/
backend/tests/
po/
Nekhelesh Ramananthan (nik90) wrote : | # |
Martin Borho (martin-borho) wrote : | # |
Yes, second folder structure seems much more organized, let us go with that one!
- 3. By Victor Thompson
-
Update file structure
Martin Borho (martin-borho) wrote : | # |
Looks good!
Should we add a blueprint "ubuntu-
Nekhelesh Ramananthan (nik90) wrote : | # |
Please move "tests" outside the app directory as it is not something we will include in our click package.
23 +add_subdirecto
Nekhelesh Ramananthan (nik90) wrote : | # |
@Victor, I made the necessary fixes and changes to https:/
- 4. By Victor Thompson
-
Merge nik90's changes
- 5. By Victor Thompson
-
Remove last Clock app reference
Nekhelesh Ramananthan (nik90) wrote : | # |
LGTM! I think the basic stuff needed to start development and running on phone is now complete with this MR. We can do debian and autopilot setup in separate MPs.
Martin Borho (martin-borho) wrote : | # |
Looks good for me too! Let's go! :)
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2015-01-22 21:56:55 +0000 | |||
3 | +++ CMakeLists.txt 2015-01-24 00:41:21 +0000 | |||
4 | @@ -1,95 +1,108 @@ | |||
5 | 1 | project(com.ubuntu.weather) | 1 | project(com.ubuntu.weather) |
6 | 2 | cmake_minimum_required(VERSION 2.8.9) | 2 | cmake_minimum_required(VERSION 2.8.9) |
7 | 3 | |||
8 | 3 | find_program(INTLTOOL_MERGE intltool-merge) | 4 | find_program(INTLTOOL_MERGE intltool-merge) |
9 | 5 | if(NOT INTLTOOL_MERGE) | ||
10 | 6 | message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package") | ||
11 | 7 | endif() | ||
12 | 4 | find_program(INTLTOOL_EXTRACT intltool-extract) | 8 | find_program(INTLTOOL_EXTRACT intltool-extract) |
13 | 9 | if(NOT INTLTOOL_EXTRACT) | ||
14 | 10 | message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package") | ||
15 | 11 | endif() | ||
16 | 12 | |||
17 | 13 | set (UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Relative path to the manifest file") | ||
18 | 14 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive -pedantic -Wall -Wextra") | ||
19 | 5 | 15 | ||
20 | 6 | find_package(Qt5Core REQUIRED) | 16 | find_package(Qt5Core REQUIRED) |
21 | 7 | find_package(Qt5Qml REQUIRED) | 17 | find_package(Qt5Qml REQUIRED) |
22 | 8 | find_package(Qt5Quick REQUIRED) | 18 | find_package(Qt5Quick REQUIRED) |
23 | 19 | |||
24 | 20 | # Automatically create moc files | ||
25 | 9 | set(CMAKE_AUTOMOC ON) | 21 | set(CMAKE_AUTOMOC ON) |
26 | 10 | 22 | ||
27 | 23 | option(INSTALL_TESTS "Install the tests on make install" on) | ||
28 | 24 | option(CLICK_MODE "Build as a click package" on) | ||
29 | 25 | |||
30 | 26 | # Tests | ||
31 | 27 | enable_testing() | ||
32 | 28 | |||
33 | 11 | # Standard install paths | 29 | # Standard install paths |
34 | 12 | include(GNUInstallDirs) | 30 | include(GNUInstallDirs) |
35 | 13 | 31 | ||
36 | 14 | option(INSTALL_TESTS "Install the tests on make install" on) | ||
37 | 15 | option(CLICK_MODE "Installs to a contained location" on) | ||
38 | 16 | |||
39 | 17 | set(APP_NAME weather) | 32 | set(APP_NAME weather) |
40 | 18 | set(DESKTOP_FILE "${PROJECT_NAME}_${APP_NAME}.desktop") | ||
41 | 19 | set(APP_HARDCODE ubuntu-weather-app) | 33 | set(APP_HARDCODE ubuntu-weather-app) |
44 | 20 | set(MAIN_QML ubuntu-weather-app.qml) | 34 | set(MAIN_QML ${APP_HARDCODE}.qml) |
45 | 21 | set(ICON_FILE weather-app@30.png) | 35 | set(DESKTOP_FILE "${APP_HARDCODE}.desktop") |
46 | 36 | set(ICON weather-app@30.png) | ||
47 | 22 | set(AUTOPILOT_DIR ubuntu_weather_app) | 37 | set(AUTOPILOT_DIR ubuntu_weather_app) |
63 | 23 | set(UBUNTU_MANIFEST_PATH "click/manifest.json.in" CACHE INTERNAL "Relative path to the manifest file") | 38 | |
64 | 24 | 39 | # Set install paths | |
50 | 25 | # components PATH | ||
51 | 26 | execute_process( | ||
52 | 27 | COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH | ||
53 | 28 | OUTPUT_VARIABLE ARCH_TRIPLET | ||
54 | 29 | OUTPUT_STRIP_TRAILING_WHITESPACE | ||
55 | 30 | ) | ||
56 | 31 | set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}") | ||
57 | 32 | execute_process( | ||
58 | 33 | COMMAND dpkg-architecture -qDEB_HOST_ARCH | ||
59 | 34 | OUTPUT_VARIABLE CLICK_ARCH | ||
60 | 35 | OUTPUT_STRIP_TRAILING_WHITESPACE | ||
61 | 36 | ) | ||
62 | 37 | |||
65 | 38 | if(CLICK_MODE) | 40 | if(CLICK_MODE) |
76 | 39 | if(NOT DEFINED BZR_SOURCE) | 41 | set(CMAKE_INSTALL_PREFIX "/") |
77 | 40 | set(BZR_SOURCE "lp:${APP_HARDCODE}") | 42 | set(UBUNTU-WEATHER_APP_DIR "${CMAKE_INSTALL_DATADIR}/qml") |
78 | 41 | message("-- Setting BZR_SOURCE to ${BZR_SOURCE}") | 43 | |
79 | 42 | endif(NOT DEFINED BZR_SOURCE) | 44 | set(QT_IMPORTS_DIR "${CMAKE_INSTALL_LIBDIR}") |
80 | 43 | set(CMAKE_INSTALL_PREFIX /) | 45 | set(EXEC "qmlscene $@ ${UBUNTU-WEATHER_APP_DIR}/${MAIN_QML}") |
81 | 44 | set(CMAKE_INSTALL_BINDIR /) | 46 | set(MODULE_PATH ${QT_IMPORTS_DIR}) |
82 | 45 | set(DATA_DIR /) | 47 | if(NOT BZR_REVNO) |
83 | 46 | set(ICON ${ICON_FILE}) | 48 | execute_process( |
84 | 47 | set(EXEC "qmlscene $@ ${MAIN_QML}") | 49 | COMMAND bzr revno |
85 | 48 | set(DESKTOP_DIR ${DATA_DIR}) | 50 | OUTPUT_VARIABLE BZR_REVNO |
86 | 51 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
87 | 52 | OUTPUT_STRIP_TRAILING_WHITESPACE | ||
88 | 53 | ) | ||
89 | 54 | endif(NOT BZR_REVNO) | ||
90 | 55 | if(NOT BZR_SOURCE) | ||
91 | 56 | set(BZR_SOURCE "lp:${APP_HARDCODE}/reboot") | ||
92 | 57 | message("-- Setting BZR_SOURCE to ${BZR_SOURCE}") | ||
93 | 58 | endif(NOT BZR_SOURCE) | ||
94 | 49 | else(CLICK_MODE) | 59 | else(CLICK_MODE) |
103 | 50 | set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE}) | 60 | set(UBUNTU-WEATHER_APP_DIR "${CMAKE_INSTALL_DATADIR}/ubuntu-weather-app") |
104 | 51 | set(EXEC ${APP_HARDCODE}) | 61 | execute_process( |
105 | 52 | set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON_FILE}) | 62 | COMMAND qmake -query QT_INSTALL_QML |
106 | 53 | configure_file(${APP_HARDCODE}.in | 63 | OUTPUT_VARIABLE QT_IMPORTS_DIR |
107 | 54 | ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}) | 64 | OUTPUT_STRIP_TRAILING_WHITESPACE |
108 | 55 | install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE} | 65 | ) |
109 | 56 | DESTINATION ${CMAKE_INSTALL_BINDIR}) | 66 | set(MODULE_PATH ${QT_IMPORTS_DIR}/WeatherApp) |
102 | 57 | set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications) | ||
110 | 58 | endif(CLICK_MODE) | 67 | endif(CLICK_MODE) |
111 | 59 | 68 | ||
112 | 69 | if(${CLICK_MODE}) | ||
113 | 70 | message("-- Configuring manifest.json") | ||
114 | 71 | |||
115 | 72 | execute_process( | ||
116 | 73 | COMMAND dpkg-architecture -qDEB_HOST_ARCH | ||
117 | 74 | OUTPUT_VARIABLE CLICK_ARCH | ||
118 | 75 | OUTPUT_STRIP_TRAILING_WHITESPACE | ||
119 | 76 | ) | ||
120 | 77 | |||
121 | 78 | configure_file(${UBUNTU_MANIFEST_PATH} ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) | ||
122 | 79 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
123 | 80 | install(FILES "${APP_HARDCODE}.apparmor" DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
124 | 81 | else(CLICK_MODE) | ||
125 | 82 | set(EXEC "qmlscene $@ -I ${MODULE_PATH} ${CMAKE_INSTALL_PREFIX}/${UBUNTU-WEATHER_APP_DIR}/${MAIN_QML}") | ||
126 | 83 | endif() | ||
127 | 84 | |||
128 | 85 | |||
129 | 60 | file(GLOB_RECURSE I18N_SRC_FILES | 86 | file(GLOB_RECURSE I18N_SRC_FILES |
132 | 61 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po | 87 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po |
133 | 62 | components/*.qml components/*.js *.qml) | 88 | *.qml *.js) |
134 | 63 | list(APPEND I18N_SRC_FILES ${DESKTOP_FILE}.in.in.h) | 89 | list(APPEND I18N_SRC_FILES ${DESKTOP_FILE}.in.in.h) |
135 | 64 | list(SORT I18N_SRC_FILES) | 90 | list(SORT I18N_SRC_FILES) |
136 | 65 | message("Found ${I18N_SRC_FILES}") | ||
137 | 66 | |||
138 | 67 | file(GLOB SRC_FILES | ||
139 | 68 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} | ||
140 | 69 | *.qml *.js *.png *.js) | ||
141 | 70 | install(DIRECTORY components resources DESTINATION ${DATA_DIR}) | ||
142 | 71 | install(FILES key.js DESTINATION ${DATA_DIR}) | ||
143 | 72 | install(FILES ${MAIN_QML} ${ICON_FILE} DESTINATION ${DATA_DIR}) | ||
144 | 73 | 91 | ||
145 | 74 | configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in) | 92 | configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in) |
146 | 75 | 93 | ||
147 | 76 | add_custom_target(${DESKTOP_FILE} ALL | 94 | add_custom_target(${DESKTOP_FILE} ALL |
150 | 77 | COMMENT "Merging translations into ${DESKTOP_FILE}" | 95 | COMMENT "Merging translations into ${DESKTOP_FILE}..." |
151 | 78 | COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE} >/dev/null | 96 | COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE} |
152 | 79 | ) | 97 | ) |
153 | 80 | 98 | ||
154 | 81 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} | 99 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} |
164 | 82 | DESTINATION ${DESKTOP_DIR}) | 100 | DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) |
165 | 83 | 101 | ||
166 | 84 | # Tests | 102 | add_subdirectory(app) |
167 | 85 | enable_testing() | 103 | add_subdirectory(backend) |
159 | 86 | |||
160 | 87 | file(GLOB QML_JS_FILES *.qml *.js) | ||
161 | 88 | add_custom_target(ubuntu-weather-app_QMlFiles ALL SOURCES ${QML_JS_FILES}) | ||
162 | 89 | |||
163 | 90 | add_subdirectory(click) | ||
168 | 91 | add_subdirectory(po) | 104 | add_subdirectory(po) |
169 | 92 | add_subdirectory(tests) | 105 | add_subdirectory(tests) |
172 | 93 | add_subdirectory(components) | 106 | |
173 | 94 | add_subdirectory(plugins) | 107 | # TODO: Add custom target for autopilot and run. |
174 | 95 | 108 | ||
175 | 96 | 109 | ||
176 | === added directory 'app' | |||
177 | === added file 'app/CMakeLists.txt' | |||
178 | --- app/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
179 | +++ app/CMakeLists.txt 2015-01-24 00:41:21 +0000 | |||
180 | @@ -0,0 +1,15 @@ | |||
181 | 1 | if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") | ||
182 | 2 | file(GLOB QML_JS_FILES *.qml *.js) | ||
183 | 3 | add_custom_target(ubuntu-weather-app_QMlFiles ALL SOURCES ${QML_JS_FILES}) | ||
184 | 4 | endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") | ||
185 | 5 | |||
186 | 6 | |||
187 | 7 | if(CLICK_MODE) | ||
188 | 8 | set(ICON ${ICON}) | ||
189 | 9 | install(FILES ${ICON} DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
190 | 10 | endif(CLICK_MODE) | ||
191 | 11 | |||
192 | 12 | install(FILES ${MAIN_QML} DESTINATION ${UBUNTU-WEATHER_APP_DIR}) | ||
193 | 13 | |||
194 | 14 | add_subdirectory(components) | ||
195 | 15 | |||
196 | 0 | 16 | ||
197 | === added directory 'app/components' | |||
198 | === added file 'app/components/CMakeLists.txt' | |||
199 | --- app/components/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
200 | +++ app/components/CMakeLists.txt 2015-01-24 00:41:21 +0000 | |||
201 | @@ -0,0 +1,5 @@ | |||
202 | 1 | file(GLOB COMPONENTS_QML_JS_FILES *.qml *.js) | ||
203 | 2 | |||
204 | 3 | add_custom_target(ubuntu-weather-app_components_QMlFiles ALL SOURCES ${COMPONENTS_QML_JS_FILES}) | ||
205 | 4 | |||
206 | 5 | install(FILES ${COMPONENTS_QML_JS_FILES} DESTINATION ${UBUNTU-WEATHER_APP_DIR}/components) | ||
207 | 0 | 6 | ||
208 | === added file 'app/ubuntu-weather-app.qml' | |||
209 | --- app/ubuntu-weather-app.qml 1970-01-01 00:00:00 +0000 | |||
210 | +++ app/ubuntu-weather-app.qml 2015-01-24 00:41:21 +0000 | |||
211 | @@ -0,0 +1,49 @@ | |||
212 | 1 | /* | ||
213 | 2 | * Copyright (C) 2015 Canonical Ltd | ||
214 | 3 | * | ||
215 | 4 | * This file is part of Ubuntu Weather App | ||
216 | 5 | * | ||
217 | 6 | * Ubuntu Weather App is free software: you can redistribute it and/or modify | ||
218 | 7 | * it under the terms of the GNU General Public License version 3 as | ||
219 | 8 | * published by the Free Software Foundation. | ||
220 | 9 | * | ||
221 | 10 | * Ubuntu Weather App is distributed in the hope that it will be useful, | ||
222 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
223 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
224 | 13 | * GNU General Public License for more details. | ||
225 | 14 | * | ||
226 | 15 | * You should have received a copy of the GNU General Public License | ||
227 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
228 | 17 | */ | ||
229 | 18 | |||
230 | 19 | import QtQuick 2.3 | ||
231 | 20 | import Ubuntu.Components 1.1 | ||
232 | 21 | |||
233 | 22 | MainView { | ||
234 | 23 | id: weatherApp | ||
235 | 24 | |||
236 | 25 | objectName: "weather" | ||
237 | 26 | |||
238 | 27 | applicationName: "com.ubuntu.weather" | ||
239 | 28 | |||
240 | 29 | automaticOrientation: false | ||
241 | 30 | |||
242 | 31 | width: units.gu(40) | ||
243 | 32 | height: units.gu(70) | ||
244 | 33 | |||
245 | 34 | backgroundColor: "#F5F5F5" | ||
246 | 35 | |||
247 | 36 | useDeprecatedToolbar: false | ||
248 | 37 | anchorToKeyboard: true | ||
249 | 38 | |||
250 | 39 | |||
251 | 40 | Page { | ||
252 | 41 | title: "Weather Reboot" | ||
253 | 42 | |||
254 | 43 | Label { | ||
255 | 44 | anchors.centerIn: parent | ||
256 | 45 | text: "Let the awesomeness begin :)" | ||
257 | 46 | } | ||
258 | 47 | |||
259 | 48 | } | ||
260 | 49 | } | ||
261 | 0 | 50 | ||
262 | === renamed file 'weather-app@30.png' => 'app/weather-app@30.png' | |||
263 | === added directory 'backend' | |||
264 | === added file 'backend/CMakeLists.txt' | |||
265 | --- backend/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
266 | +++ backend/CMakeLists.txt 2015-01-24 00:41:21 +0000 | |||
267 | @@ -0,0 +1,29 @@ | |||
268 | 1 | project(backend) | ||
269 | 2 | |||
270 | 3 | include_directories( | ||
271 | 4 | ${CMAKE_CURRENT_SOURCE_DIR} | ||
272 | 5 | ) | ||
273 | 6 | |||
274 | 7 | #set( | ||
275 | 8 | # timeZone_SRCS | ||
276 | 9 | # TimeZone/timezone.cpp | ||
277 | 10 | # TimeZone/timezone_plugin.cpp | ||
278 | 11 | #) | ||
279 | 12 | |||
280 | 13 | #add_library(TimeZoneBackend MODULE | ||
281 | 14 | # ${timeZone_SRCS} | ||
282 | 15 | #) | ||
283 | 16 | #set_target_properties(TimeZoneBackend PROPERTIES | ||
284 | 17 | # LIBRARY_OUTPUT_DIRECTORY TimeZone) | ||
285 | 18 | |||
286 | 19 | #qt5_use_modules(TimeZoneBackend Gui Qml Quick) | ||
287 | 20 | |||
288 | 21 | # Copy qmldir file to build dir for running in QtCreator | ||
289 | 22 | #add_custom_target(TimeZoneBackend-qmldir ALL | ||
290 | 23 | # COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/TimeZone/qmldir ${CMAKE_CURRENT_BINARY_DIR}/TimeZone | ||
291 | 24 | # DEPENDS ${QML_JS_FILES} | ||
292 | 25 | #) | ||
293 | 26 | |||
294 | 27 | # Install plugin file | ||
295 | 28 | #install(TARGETS TimeZoneBackend DESTINATION ${QT_IMPORTS_DIR}/qt5/qml/UbuntuWeather/TimeZone/) | ||
296 | 29 | #install(FILES TimeZone/qmldir DESTINATION ${QT_IMPORTS_DIR}/qt5/qml/UbuntuWeather/TimeZone/) | ||
297 | 0 | 30 | ||
298 | === removed directory 'click' | |||
299 | === removed file 'click/CMakeLists.txt' | |||
300 | --- click/CMakeLists.txt 2015-01-22 21:56:55 +0000 | |||
301 | +++ click/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
302 | @@ -1,15 +0,0 @@ | |||
303 | 1 | if(CLICK_MODE) | ||
304 | 2 | if(NOT BZR_REVNO) | ||
305 | 3 | set(BZR_REVNO "latest") | ||
306 | 4 | endif(NOT BZR_REVNO) | ||
307 | 5 | configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) | ||
308 | 6 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json weather.apparmor | ||
309 | 7 | DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
310 | 8 | |||
311 | 9 | # make the click files visible in qtcreator | ||
312 | 10 | file(GLOB CLICK_FILES | ||
313 | 11 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} | ||
314 | 12 | *.json *.json.in *.apparmor) | ||
315 | 13 | |||
316 | 14 | add_custom_target(com_ubuntu_weather_CLICKFiles ALL SOURCES ${CLICK_FILES}) | ||
317 | 15 | endif(CLICK_MODE) | ||
318 | 16 | 0 | ||
319 | === renamed file 'click/manifest.json.in' => 'manifest.json.in' | |||
320 | --- click/manifest.json.in 2015-01-22 21:56:55 +0000 | |||
321 | +++ manifest.json.in 2015-01-24 00:41:21 +0000 | |||
322 | @@ -4,15 +4,15 @@ | |||
323 | 4 | "framework": "ubuntu-sdk-14.10", | 4 | "framework": "ubuntu-sdk-14.10", |
324 | 5 | "hooks": { | 5 | "hooks": { |
325 | 6 | "weather": { | 6 | "weather": { |
328 | 7 | "apparmor": "weather.apparmor", | 7 | "apparmor": "ubuntu-weather-app.apparmor", |
329 | 8 | "desktop": "@DESKTOP_FILE@" | 8 | "desktop": "@CMAKE_INSTALL_DATADIR@/applications/ubuntu-weather-app.desktop" |
330 | 9 | } | 9 | } |
331 | 10 | }, | 10 | }, |
332 | 11 | "icon": "@ICON@", | 11 | "icon": "@ICON@", |
333 | 12 | "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>", | 12 | "maintainer": "Ubuntu App Cats <ubuntu-touch-coreapps@lists.launchpad.net>", |
334 | 13 | "name": "@PROJECT_NAME@", | 13 | "name": "@PROJECT_NAME@", |
335 | 14 | "title": "Weather", | 14 | "title": "Weather", |
337 | 15 | "version": "2.0.@BZR_REVNO@", | 15 | "version": "3.0.@BZR_REVNO@", |
338 | 16 | "x-source": { | 16 | "x-source": { |
339 | 17 | "vcs-bzr": "@BZR_SOURCE@", | 17 | "vcs-bzr": "@BZR_SOURCE@", |
340 | 18 | "vcs-bzr-revno": "@BZR_REVNO@" | 18 | "vcs-bzr-revno": "@BZR_REVNO@" |
341 | 19 | 19 | ||
342 | === added directory 'po' | |||
343 | === added file 'po/CMakeLists.txt' | |||
344 | --- po/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
345 | +++ po/CMakeLists.txt 2015-01-24 00:41:21 +0000 | |||
346 | @@ -0,0 +1,33 @@ | |||
347 | 1 | include(FindGettext) | ||
348 | 2 | find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext) | ||
349 | 3 | |||
350 | 4 | set(DOMAIN ${PROJECT_NAME}) | ||
351 | 5 | set(POT_FILE ${DOMAIN}.pot) | ||
352 | 6 | file(GLOB PO_FILES *.po) | ||
353 | 7 | |||
354 | 8 | # Creates the .pot file containing the translations template | ||
355 | 9 | add_custom_target(${POT_FILE} ALL | ||
356 | 10 | COMMENT "Generating translation template" | ||
357 | 11 | COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini | ||
358 | 12 | --srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE}.in.in | ||
359 | 13 | COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE} | ||
360 | 14 | -D ${CMAKE_CURRENT_SOURCE_DIR} | ||
361 | 15 | -D ${CMAKE_CURRENT_BINARY_DIR} | ||
362 | 16 | --from-code=UTF-8 | ||
363 | 17 | --c++ --qt --add-comments=TRANSLATORS | ||
364 | 18 | --keyword=tr --keyword=tr:1,2 --keyword=N_ | ||
365 | 19 | --package-name='${APP_HARDCODE}' | ||
366 | 20 | --copyright-holder='Canonical Ltd.' | ||
367 | 21 | ${I18N_SRC_FILES} | ||
368 | 22 | COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}) | ||
369 | 23 | |||
370 | 24 | # Builds the binary translations catalog for each language | ||
371 | 25 | # it finds source translations (*.po) for | ||
372 | 26 | foreach(PO_FILE ${PO_FILES}) | ||
373 | 27 | get_filename_component(LANG ${PO_FILE} NAME_WE) | ||
374 | 28 | gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE}) | ||
375 | 29 | set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES) | ||
376 | 30 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo | ||
377 | 31 | DESTINATION ${INSTALL_DIR} | ||
378 | 32 | RENAME ${DOMAIN}.mo) | ||
379 | 33 | endforeach(PO_FILE) | ||
380 | 0 | 34 | ||
381 | === added file 'po/com.ubuntu.weather.pot' | |||
382 | --- po/com.ubuntu.weather.pot 1970-01-01 00:00:00 +0000 | |||
383 | +++ po/com.ubuntu.weather.pot 2015-01-24 00:41:21 +0000 | |||
384 | @@ -0,0 +1,32 @@ | |||
385 | 1 | # SOME DESCRIPTIVE TITLE. | ||
386 | 2 | # Copyright (C) YEAR Canonical Ltd. | ||
387 | 3 | # This file is distributed under the same license as the PACKAGE package. | ||
388 | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
389 | 5 | # | ||
390 | 6 | #, fuzzy | ||
391 | 7 | msgid "" | ||
392 | 8 | msgstr "" | ||
393 | 9 | "Project-Id-Version: ubuntu-weather-app\n" | ||
394 | 10 | "Report-Msgid-Bugs-To: \n" | ||
395 | 11 | "POT-Creation-Date: 2015-01-24 00:26+0100\n" | ||
396 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
397 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
398 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | ||
399 | 15 | "Language: \n" | ||
400 | 16 | "MIME-Version: 1.0\n" | ||
401 | 17 | "Content-Type: text/plain; charset=CHARSET\n" | ||
402 | 18 | "Content-Transfer-Encoding: 8bit\n" | ||
403 | 19 | |||
404 | 20 | #: ubuntu-weather-app.desktop.in.in.h:1 | ||
405 | 21 | msgid "Weather" | ||
406 | 22 | msgstr "" | ||
407 | 23 | |||
408 | 24 | #: ubuntu-weather-app.desktop.in.in.h:2 | ||
409 | 25 | msgid "" | ||
410 | 26 | "A weather forecast application for Ubuntu with support for multiple online " | ||
411 | 27 | "weather data sources" | ||
412 | 28 | msgstr "" | ||
413 | 29 | |||
414 | 30 | #: ubuntu-weather-app.desktop.in.in.h:3 | ||
415 | 31 | msgid "weather;forecast;twc;openweathermap;the weather channel;" | ||
416 | 32 | msgstr "" | ||
417 | 0 | 33 | ||
418 | === added directory 'tests' | |||
419 | === added file 'tests/CMakeLists.txt' | |||
420 | --- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
421 | +++ tests/CMakeLists.txt 2015-01-24 00:41:21 +0000 | |||
422 | @@ -0,0 +1,3 @@ | |||
423 | 1 | if(NOT CLICK_MODE) | ||
424 | 2 | add_subdirectory(autopilot) | ||
425 | 3 | endif(NOT CLICK_MODE) | ||
426 | 0 | 4 | ||
427 | === added directory 'tests/autopilot' | |||
428 | === added file 'tests/autopilot/CMakeLists.txt' | |||
429 | --- tests/autopilot/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
430 | +++ tests/autopilot/CMakeLists.txt 2015-01-24 00:41:21 +0000 | |||
431 | @@ -0,0 +1,8 @@ | |||
432 | 1 | if(INSTALL_TESTS) | ||
433 | 2 | execute_process(COMMAND python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" | ||
434 | 3 | OUTPUT_VARIABLE PYTHON_PACKAGE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
435 | 4 | |||
436 | 5 | install(DIRECTORY ${AUTOPILOT_DIR} | ||
437 | 6 | DESTINATION ${PYTHON_PACKAGE_DIR} | ||
438 | 7 | ) | ||
439 | 8 | endif(INSTALL_TESTS) | ||
440 | 0 | 9 | ||
441 | === added directory 'tests/autopilot/ubuntu_weather_app' | |||
442 | === renamed file 'click/weather.apparmor' => 'ubuntu-weather-app.apparmor' | |||
443 | --- click/weather.apparmor 2015-01-22 21:56:55 +0000 | |||
444 | +++ ubuntu-weather-app.apparmor 2015-01-24 00:41:21 +0000 | |||
445 | @@ -1,5 +1,6 @@ | |||
446 | 1 | { | 1 | { |
449 | 2 | "policy_groups": ["networking" | 2 | "policy_groups": [ |
450 | 3 | ], | 3 | "networking" |
451 | 4 | ], | ||
452 | 4 | "policy_version": 1.2 | 5 | "policy_version": 1.2 |
453 | 5 | } | 6 | } |
454 | 6 | 7 | ||
455 | === renamed file 'com.ubuntu.weather_weather.desktop.in.in' => 'ubuntu-weather-app.desktop.in.in' | |||
456 | === removed file 'ubuntu-weather-app.in' | |||
457 | --- ubuntu-weather-app.in 2015-01-22 21:56:55 +0000 | |||
458 | +++ ubuntu-weather-app.in 1970-01-01 00:00:00 +0000 | |||
459 | @@ -1,3 +0,0 @@ | |||
460 | 1 | #!/bin/bash | ||
461 | 2 | export QT_SELECT=qt5 | ||
462 | 3 | exec qmlscene @CMAKE_INSTALL_PREFIX@/@DATA_DIR@/@MAIN_QML@ | ||
463 | 4 | 0 | ||
464 | === removed file 'ubuntu-weather-app.qmlproject' | |||
465 | --- ubuntu-weather-app.qmlproject 2015-01-22 21:56:55 +0000 | |||
466 | +++ ubuntu-weather-app.qmlproject 1970-01-01 00:00:00 +0000 | |||
467 | @@ -1,32 +0,0 @@ | |||
468 | 1 | /* File generated by Qt Creator, version 2.6.1 */ | ||
469 | 2 | |||
470 | 3 | import QmlProject 1.1 | ||
471 | 4 | |||
472 | 5 | Project { | ||
473 | 6 | mainFile: "ubuntu-weather-app.qml" | ||
474 | 7 | |||
475 | 8 | /* Include .qml, .js, and image files from current directory and subdirectories */ | ||
476 | 9 | QmlFiles { | ||
477 | 10 | directory: "." | ||
478 | 11 | } | ||
479 | 12 | JavaScriptFiles { | ||
480 | 13 | directory: "." | ||
481 | 14 | } | ||
482 | 15 | ImageFiles { | ||
483 | 16 | directory: "." | ||
484 | 17 | } | ||
485 | 18 | /* Shows the README files in the project view */ | ||
486 | 19 | Files { | ||
487 | 20 | filter: "README*" | ||
488 | 21 | } | ||
489 | 22 | /* Shows the translation files and the .pro file used to generate the .pot template */ | ||
490 | 23 | Files { | ||
491 | 24 | filter: "*.po*" | ||
492 | 25 | } | ||
493 | 26 | /* Shows the CMake files */ | ||
494 | 27 | Files { | ||
495 | 28 | filter: "CMakeLists.txt" | ||
496 | 29 | } | ||
497 | 30 | /* List of plugin directories passed to QML runtime */ | ||
498 | 31 | importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ] | ||
499 | 32 | } |
I would also recommend going with the 2nd folder structure (which is also how QtC lays out) since personally I think it is more organized. Waiting for a decision from m-b-o.