199.1.5
by Kunal Parmar
Unnecessary changes removed |
1 |
project(com.ubuntu.calendar) |
182.1.1
by Sergio Schvezov
Adding cmake |
2 |
cmake_minimum_required(VERSION 2.8.9) |
301.1.1
by David Planella
Added inline translations support to the .desktop file |
3 |
find_program(INTLTOOL_MERGE intltool-merge) |
4 |
find_program(INTLTOOL_EXTRACT intltool-extract) |
|
182.1.1
by Sergio Schvezov
Adding cmake |
5 |
|
6 |
# Standard install paths
|
|
7 |
include(GNUInstallDirs) |
|
8 |
||
9 |
option(INSTALL_TESTS "Install the tests on make install" on) |
|
436.1.1
by Benjamin Zeller
Make Calendar app cmake project useable out of the Box with QtCreator |
10 |
option(CLICK_MODE "Installs to a contained location" on) |
182.1.1
by Sergio Schvezov
Adding cmake |
11 |
|
12 |
set(APP_NAME calendar) |
|
199.1.5
by Kunal Parmar
Unnecessary changes removed |
13 |
set(DESKTOP_FILE "${PROJECT_NAME}_${APP_NAME}.desktop") |
475.1.1
by Renato Araujo Oliveira Filho
Install online accounts application file necessary to enable calendar sync. |
14 |
set(APPLICATION_FILE "${PROJECT_NAME}_${APP_NAME}.application") |
199.1.5
by Kunal Parmar
Unnecessary changes removed |
15 |
set(URLS_FILE "${PROJECT_NAME}_${APP_NAME}.url-dispatcher") |
182.1.1
by Sergio Schvezov
Adding cmake |
16 |
set(MAIN_QML calendar.qml) |
201.1.2
by David Planella
Update the icon, while at it |
17 |
set(ICON_FILE calendar-app@30.png) |
182.1.1
by Sergio Schvezov
Adding cmake |
18 |
set(AUTOPILOT_DIR calendar_app) |
19 |
set(APP_HARDCODE calendar-app) |
|
436.1.1
by Benjamin Zeller
Make Calendar app cmake project useable out of the Box with QtCreator |
20 |
set(UBUNTU_MANIFEST_PATH "click/manifest.json.in" CACHE INTERNAL "Relative path to the manifest file") |
182.1.1
by Sergio Schvezov
Adding cmake |
21 |
|
22 |
if(CLICK_MODE) |
|
23 |
if(NOT DEFINED BZR_SOURCE) |
|
475.1.1
by Renato Araujo Oliveira Filho
Install online accounts application file necessary to enable calendar sync. |
24 |
set(BZR_SOURCE "lp:ubuntu-${APP_HARDCODE}") |
25 |
message("-- Setting BZR_SOURCE to ${BZR_SOURCE}") |
|
182.1.1
by Sergio Schvezov
Adding cmake |
26 |
endif(NOT DEFINED BZR_SOURCE) |
27 |
set(CMAKE_INSTALL_PREFIX /) |
|
28 |
set(CMAKE_INSTALL_BINDIR /) |
|
475.1.1
by Renato Araujo Oliveira Filho
Install online accounts application file necessary to enable calendar sync. |
29 |
set(DATA_DIR /) |
30 |
set(ICON ${ICON_FILE}) |
|
31 |
set(EXEC "qmlscene %u ${MAIN_QML}") |
|
32 |
set(DESKTOP_DIR ${DATA_DIR}) |
|
33 |
set(URLS_DIR ${DATA_DIR}) |
|
34 |
set(APPLICATION_DIR ${DATA_DIR}) |
|
182.1.1
by Sergio Schvezov
Adding cmake |
35 |
else(CLICK_MODE) |
475.1.1
by Renato Araujo Oliveira Filho
Install online accounts application file necessary to enable calendar sync. |
36 |
set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE}) |
37 |
set(EXEC ${APP_HARDCODE}) |
|
38 |
set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON_FILE}) |
|
39 |
configure_file(${APP_HARDCODE}.in |
|
40 |
${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}) |
|
41 |
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE} |
|
42 |
DESTINATION ${CMAKE_INSTALL_BINDIR}) |
|
43 |
set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications) |
|
44 |
set(URLS_DIR ${CMAKE_INSTALL_DATADIR}/url-dispatcher/urls) |
|
45 |
set(APPLICATION_DIR ${CMAKE_INSTALL_DATADIR}/accounts/applications) |
|
182.1.1
by Sergio Schvezov
Adding cmake |
46 |
endif(CLICK_MODE) |
47 |
||
48 |
file(GLOB_RECURSE I18N_SRC_FILES |
|
301.1.1
by David Planella
Added inline translations support to the .desktop file |
49 |
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po |
50 |
*.qml *.js) |
|
51 |
list(APPEND I18N_SRC_FILES ${DESKTOP_FILE}.in.in.h) |
|
182.1.1
by Sergio Schvezov
Adding cmake |
52 |
list(SORT I18N_SRC_FILES) |
301.1.1
by David Planella
Added inline translations support to the .desktop file |
53 |
message("Found ${I18N_SRC_FILES}") |
182.1.1
by Sergio Schvezov
Adding cmake |
54 |
|
55 |
file(GLOB SRC_FILES |
|
56 |
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} |
|
436.1.2
by Benjamin Zeller
Add qml files to the project tree |
57 |
*.qml *.js) |
58 |
add_custom_target(ubuntu-calendar-app_QMlFiles ALL SOURCES ${SRC_FILES}) |
|
59 |
||
60 |
file(GLOB RESOURCE_FILES |
|
61 |
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} |
|
62 |
*.png *.svg) |
|
63 |
install(FILES ${SRC_FILES} ${RESOURCE_FILES} ${ICON_FILE} DESTINATION ${DATA_DIR}) |
|
182.1.1
by Sergio Schvezov
Adding cmake |
64 |
|
301.1.1
by David Planella
Added inline translations support to the .desktop file |
65 |
configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in) |
66 |
||
67 |
add_custom_target(${DESKTOP_FILE} ALL |
|
68 |
COMMENT "Merging translations into ${DESKTOP_FILE}" |
|
69 |
COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${DESKTOP_FILE}.in ${DESKTOP_FILE} >/dev/null |
|
70 |
)
|
|
71 |
||
182.1.1
by Sergio Schvezov
Adding cmake |
72 |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR}) |
475.1.1
by Renato Araujo Oliveira Filho
Install online accounts application file necessary to enable calendar sync. |
73 |
|
180.3.4
by Ted Gould
Making the URL dispatcher work more like the desktop file stuff does now |
74 |
install(FILES ${URLS_FILE} DESTINATION ${URLS_DIR}) |
75 |
||
475.1.1
by Renato Araujo Oliveira Filho
Install online accounts application file necessary to enable calendar sync. |
76 |
install(FILES ${APPLICATION_FILE} DESTINATION ${APPLICATION_DIR}) |
77 |
||
182.1.1
by Sergio Schvezov
Adding cmake |
78 |
# Tests
|
79 |
enable_testing() |
|
80 |
||
81 |
add_subdirectory(click) |
|
459.1.4
by Mihir Soni
uncommented po direcotry in CMake |
82 |
add_subdirectory(po) |
182.1.1
by Sergio Schvezov
Adding cmake |
83 |
add_subdirectory(tests) |