~pkunal-parmar/ubuntu-calendar-app/ICalImport

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Sergio Schvezov
  • Date: 2014-01-18 23:29:11 UTC
  • mto: This revision was merged to the branch mainline in revision 184.
  • Revision ID: sergio.schvezov@canonical.com-20140118232911-p3jdkkomszdl2l70
Adding cmake 

Show diffs side-by-side

added added

removed removed

Lines of Context:
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)
5
3
 
6
4
# Standard install paths
7
5
include(GNUInstallDirs)
8
6
 
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)
11
9
 
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")
21
16
 
22
17
if(CLICK_MODE)
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 /)
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})
 
24
        set(DATA_DIR /)
 
25
        set(EXEC "qmlscene %u ${MAIN_QML}")
 
26
        set(DESKTOP_DIR ${DATA_DIR})
35
27
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)
 
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)
46
36
endif(CLICK_MODE)
47
37
 
48
38
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)
 
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}")
 
42
 
54
43
 
55
44
file(GLOB SRC_FILES
56
45
     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
 
 
 
46
     *.qml *.js *.png *.js)
 
47
install(FILES ${SRC_FILES}  DESTINATION ${DATA_DIR})
 
48
 
 
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})
73
 
 
74
 
install(FILES ${URLS_FILE} DESTINATION ${URLS_DIR})
75
 
 
76
 
install(FILES ${APPLICATION_FILE} DESTINATION ${APPLICATION_DIR})
77
 
 
 
51
 
78
52
# Tests
79
53
enable_testing()
80
54