1
1
project(com.ubuntu.calendar)
2
2
cmake_minimum_required(VERSION 2.8.9)
3
find_program(INTLTOOL_MERGE intltool-merge)
4
find_program(INTLTOOL_EXTRACT intltool-extract)
6
4
# Standard install paths
7
5
include(GNUInstallDirs)
9
7
option(INSTALL_TESTS "Install the tests on make install" on)
10
option(CLICK_MODE "Installs to a contained location" on)
8
option(CLICK_MODE "Installs to a contained location" off)
12
10
set(APP_NAME calendar)
13
11
set(DESKTOP_FILE "${PROJECT_NAME}_${APP_NAME}.desktop")
14
set(APPLICATION_FILE "${PROJECT_NAME}_${APP_NAME}.application")
15
set(URLS_FILE "${PROJECT_NAME}_${APP_NAME}.url-dispatcher")
16
12
set(MAIN_QML calendar.qml)
17
set(ICON_FILE calendar-app@30.png)
13
set(ICON calendar64.png)
18
14
set(AUTOPILOT_DIR calendar_app)
19
15
set(APP_HARDCODE calendar-app)
20
set(UBUNTU_MANIFEST_PATH "click/manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
23
18
if(NOT DEFINED BZR_SOURCE)
24
set(BZR_SOURCE "lp:ubuntu-${APP_HARDCODE}")
25
message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
19
set(BZR_SOURCE "lp:ubuntu-${APP_HARDCODE}")
20
message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
26
21
endif(NOT DEFINED BZR_SOURCE)
27
22
set(CMAKE_INSTALL_PREFIX /)
28
23
set(CMAKE_INSTALL_BINDIR /)
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})
25
set(EXEC "qmlscene %u ${MAIN_QML}")
26
set(DESKTOP_DIR ${DATA_DIR})
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)
28
set(DATA_DIR ${CMAKE_INSTALL_DATADIR}/${APP_HARDCODE})
29
set(EXEC ${APP_HARDCODE})
30
set(ICON ${CMAKE_INSTALL_PREFIX}/${DATA_DIR}/${ICON})
31
configure_file(${APP_HARDCODE}.in
32
${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE})
33
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${APP_HARDCODE}
34
DESTINATION ${CMAKE_INSTALL_BINDIR})
35
set(DESKTOP_DIR ${CMAKE_INSTALL_DATADIR}/applications)
48
38
file(GLOB_RECURSE I18N_SRC_FILES
49
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po
51
list(APPEND I18N_SRC_FILES ${DESKTOP_FILE}.in.in.h)
39
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
40
rc/**.qml desktop/**.desktop.in)
52
41
list(SORT I18N_SRC_FILES)
53
message("Found ${I18N_SRC_FILES}")
55
44
file(GLOB SRC_FILES
56
45
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
58
add_custom_target(ubuntu-calendar-app_QMlFiles ALL SOURCES ${SRC_FILES})
60
file(GLOB RESOURCE_FILES
61
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
63
install(FILES ${SRC_FILES} ${RESOURCE_FILES} ${ICON_FILE} DESTINATION ${DATA_DIR})
65
configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in)
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
46
*.qml *.js *.png *.js)
47
install(FILES ${SRC_FILES} DESTINATION ${DATA_DIR})
49
configure_file(${DESKTOP_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
72
50
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR})
74
install(FILES ${URLS_FILE} DESTINATION ${URLS_DIR})
76
install(FILES ${APPLICATION_FILE} DESTINATION ${APPLICATION_DIR})