38.2.3
by Riccardo Padovani
Readded some edits |
1 |
project(com.ubuntu.calculator) |
1
by Riccardo Padovani
Starting a new adventure, yeah! |
2 |
cmake_minimum_required(VERSION 2.8.9) |
3 |
||
38.2.3
by Riccardo Padovani
Readded some edits |
4 |
find_program(INTLTOOL_MERGE intltool-merge) |
5 |
if(NOT INTLTOOL_MERGE) |
|
38.2.8
by Riccardo Padovani
Fixed code style |
6 |
message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package") |
7 |
endif(NOT INTLTOOL_MERGE) |
|
38.2.3
by Riccardo Padovani
Readded some edits |
8 |
|
9 |
find_program(INTLTOOL_EXTRACT intltool-extract) |
|
10 |
if(NOT INTLTOOL_EXTRACT) |
|
38.2.8
by Riccardo Padovani
Fixed code style |
11 |
message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package") |
12 |
endif(NOT INTLTOOL_EXTRACT) |
|
38.2.3
by Riccardo Padovani
Readded some edits |
13 |
|
1
by Riccardo Padovani
Starting a new adventure, yeah! |
14 |
set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file") |
15 |
||
38.1.1
by Mattia Rizzolo
Do some QA here and there (and fix FTBFS due to useless debian/.install). Force build-dep on qt* |
16 |
find_package(Qt5Core REQUIRED) |
17 |
find_package(Qt5Qml REQUIRED) |
|
18 |
find_package(Qt5Quick REQUIRED) |
|
1
by Riccardo Padovani
Starting a new adventure, yeah! |
19 |
# Find_package(ubuntu-sdk-libs)
|
20 |
||
21 |
#automatically create moc files
|
|
22 |
set(CMAKE_AUTOMOC ON) |
|
23 |
||
38.2.11
by Riccardo Padovani
Added CMake for tests |
24 |
|
25 |
option(INSTALL_TESTS "Install the tests on make install" on) |
|
38.2.3
by Riccardo Padovani
Readded some edits |
26 |
option(CLICK_MODE "Installs to a contained location" on) |
27 |
||
28 |
include(GNUInstallDirs) |
|
29 |
||
30 |
set(APP_NAME ubuntu-calculator-app) |
|
31 |
set(APP_HARDCODE ubuntu-calculator-app) |
|
38.2.11
by Riccardo Padovani
Added CMake for tests |
32 |
set(AUTOPILOT_DIR ubuntu_calculator_app) |
38.2.3
by Riccardo Padovani
Readded some edits |
33 |
set(MAIN_QML ${APP_HARDCODE}.qml) |
45.2.1
by Giulio Collura
Introduce ScrollableView, fix CMakelists to correctly create click pkgs |
34 |
set(ICON "${APP_HARDCODE}.png") |
38.2.3
by Riccardo Padovani
Readded some edits |
35 |
set(DESKTOP_FILE "${APP_HARDCODE}.desktop") |
77.2.1
by Bartosz Kosiorek
Fix configuration files for Ubuntu SDK and Click packages |
36 |
set(AUTOPILOT_DIR ubuntu_calculator_app) |
37 |
set(APP_VERSION 2.0) |
|
38.2.3
by Riccardo Padovani
Readded some edits |
38 |
|
39 |
if(CLICK_MODE) |
|
40 |
set(CMAKE_INSTALL_PREFIX "/") |
|
41 |
set(UBUNTU-CALCULATOR-APP_DIR "${CMAKE_INSTALL_DATADIR}/qml") |
|
42 |
||
43 |
set(QT_IMPORTS_DIR "${CMAKE_INSTALL_LIBDIR}") |
|
44 |
set(EXEC "qmlscene $@ ${UBUNTU-CALCULATOR-APP_DIR}/${MAIN_QML}") |
|
45 |
set(MODULE_PATH ${QT_IMPORTS_DIR}) |
|
46 |
if(NOT BZR_REVNO) |
|
47 |
execute_process( |
|
48 |
COMMAND bzr revno |
|
49 |
OUTPUT_VARIABLE BZR_REVNO |
|
50 |
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|
51 |
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
77.2.1
by Bartosz Kosiorek
Fix configuration files for Ubuntu SDK and Click packages |
52 |
)
|
38.2.3
by Riccardo Padovani
Readded some edits |
53 |
endif(NOT BZR_REVNO) |
54 |
if(NOT BZR_SOURCE) |
|
55 |
set(BZR_SOURCE lp:${APP_HARDCODE}) |
|
56 |
message("-- Setting BZR_SOURCE to ${BZR_SOURCE}") |
|
57 |
endif(NOT BZR_SOURCE) |
|
58 |
else(CLICK_MODE) |
|
59 |
set(UBUNTU-CALCULATOR-APP_DIR "${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE}") |
|
60 |
execute_process( |
|
61 |
COMMAND qmake -query QT_INSTALL_QML |
|
62 |
OUTPUT_VARIABLE QT_IMPORTS_DIR |
|
63 |
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
38.2.8
by Riccardo Padovani
Fixed code style |
64 |
)
|
38.2.3
by Riccardo Padovani
Readded some edits |
65 |
endif(CLICK_MODE) |
66 |
||
38.2.11
by Riccardo Padovani
Added CMake for tests |
67 |
if(CLICK_MODE) |
38.2.3
by Riccardo Padovani
Readded some edits |
68 |
message("-- Configuring manifest.json") |
69 |
||
70 |
execute_process( |
|
71 |
COMMAND dpkg-architecture -qDEB_HOST_ARCH |
|
38.2.8
by Riccardo Padovani
Fixed code style |
72 |
OUTPUT_VARIABLE CLICK_ARCH |
73 |
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
38.2.3
by Riccardo Padovani
Readded some edits |
74 |
)
|
75 |
||
76 |
configure_file(${UBUNTU_MANIFEST_PATH} ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) |
|
77 |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX}) |
|
45.2.1
by Giulio Collura
Introduce ScrollableView, fix CMakelists to correctly create click pkgs |
78 |
install(FILES "${APP_HARDCODE}.apparmor" DESTINATION ${CMAKE_INSTALL_PREFIX}) |
38.2.3
by Riccardo Padovani
Readded some edits |
79 |
else(CLICK_MODE) |
80 |
set(EXEC "qmlscene $@ -I ${MODULE_PATH} ${CMAKE_INSTALL_PREFIX}/${UBUNTU-CALCULATOR-APP_DIR}/${MAIN_QML}") |
|
38.2.8
by Riccardo Padovani
Fixed code style |
81 |
endif(CLICK_MODE) |
38.2.3
by Riccardo Padovani
Readded some edits |
82 |
|
61.3.1
by Bartosz Kosiorek
Fix generation of pot translation template |
83 |
file(GLOB_RECURSE I18N_SRC_FILES |
77.2.1
by Bartosz Kosiorek
Fix configuration files for Ubuntu SDK and Click packages |
84 |
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po |
85 |
*.qml *.js) |
|
61.3.4
by Bartosz Kosiorek
Translate also description inside the desktop file |
86 |
list(APPEND I18N_SRC_FILES ${CMAKE_CURRENT_BINARY_DIR}/po/${DESKTOP_FILE}.in.in.h) |
61.3.1
by Bartosz Kosiorek
Fix generation of pot translation template |
87 |
list(SORT I18N_SRC_FILES) |
38.2.3
by Riccardo Padovani
Readded some edits |
88 |
|
61.3.4
by Bartosz Kosiorek
Translate also description inside the desktop file |
89 |
configure_file(app/${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in) |
90 |
||
91 |
add_custom_target(${DESKTOP_FILE} ALL |
|
92 |
COMMENT "Merging translations into ${DESKTOP_FILE}" |
|
93 |
COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE} |
|
94 |
)
|
|
38.2.3
by Riccardo Padovani
Readded some edits |
95 |
|
96 |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} |
|
97 |
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) |
|
1
by Riccardo Padovani
Starting a new adventure, yeah! |
98 |
|
38.2.11
by Riccardo Padovani
Added CMake for tests |
99 |
# Tests
|
100 |
enable_testing() |
|
101 |
||
1
by Riccardo Padovani
Starting a new adventure, yeah! |
102 |
add_subdirectory(app) |
61.3.1
by Bartosz Kosiorek
Fix generation of pot translation template |
103 |
add_subdirectory(po) |