~pkunal-parmar/ubuntu-calendar-app/Minor-Performance

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: David Planella
  • Date: 2013-06-12 15:47:15 UTC
  • mfrom: (44 trunk)
  • mto: This revision was merged to the branch mainline in revision 50.
  • Revision ID: david.planella@ubuntu.com-20130612154715-8g4yecfgim9dh38q
Merged from trunk, renamed autopilot tests to follow the same calendar-app naming convention

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
project(com.ubuntu.calendar)
2
 
cmake_minimum_required(VERSION 2.8.9)
3
 
find_program(INTLTOOL_MERGE intltool-merge)
4
 
find_program(INTLTOOL_EXTRACT intltool-extract)
5
 
 
6
 
# Standard install paths
7
 
include(GNUInstallDirs)
8
 
 
9
 
option(INSTALL_TESTS "Install the tests on make install" on)
10
 
option(CLICK_MODE "Installs to a contained location" on)
11
 
 
12
 
set(APP_NAME calendar)
13
 
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
 
set(MAIN_QML calendar.qml)
17
 
set(ICON_FILE calendar-app@30.png)
18
 
set(AUTOPILOT_DIR calendar_app)
19
 
set(APP_HARDCODE calendar-app)
20
 
set(UBUNTU_MANIFEST_PATH "click/manifest.json.in" CACHE INTERNAL "Relative path to the manifest file")
21
 
 
22
 
if(CLICK_MODE)
23
 
    if(NOT DEFINED BZR_SOURCE)
24
 
        set(BZR_SOURCE "lp:ubuntu-${APP_HARDCODE}")
25
 
        message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
26
 
    endif(NOT DEFINED BZR_SOURCE)
27
 
    set(CMAKE_INSTALL_PREFIX /)
28
 
    set(CMAKE_INSTALL_BINDIR /)
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})
35
 
else(CLICK_MODE)
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)
46
 
endif(CLICK_MODE)
47
 
 
48
 
file(GLOB_RECURSE I18N_SRC_FILES
49
 
     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po
50
 
     *.qml *.js)
51
 
list(APPEND I18N_SRC_FILES ${DESKTOP_FILE}.in.in.h)
52
 
list(SORT I18N_SRC_FILES)
53
 
message("Found ${I18N_SRC_FILES}")
54
 
 
55
 
file(GLOB SRC_FILES
56
 
     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
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})
64
 
 
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
 
 
72
 
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR})
73
 
 
74
 
install(FILES ${URLS_FILE} DESTINATION ${URLS_DIR})
75
 
 
76
 
install(FILES ${APPLICATION_FILE} DESTINATION ${APPLICATION_DIR})
77
 
 
78
 
# Tests
79
 
enable_testing()
80
 
 
81
 
add_subdirectory(click)
82
 
add_subdirectory(po)
83
 
add_subdirectory(tests)