~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
project(com.ubuntu.calendar)
 
2
cmake_minimum_required(VERSION 2.8.9)
 
3
 
 
4
# Standard install paths
 
5
include(GNUInstallDirs)
 
6
 
 
7
option(INSTALL_TESTS "Install the tests on make install" on)
 
8
option(CLICK_MODE "Installs to a contained location" off)
 
9
 
 
10
set(APP_NAME calendar)
 
11
set(DESKTOP_FILE "${PROJECT_NAME}_${APP_NAME}.desktop")
 
12
set(MAIN_QML calendar.qml)
 
13
set(ICON calendar64.png)
 
14
set(AUTOPILOT_DIR calendar_app)
 
15
set(APP_HARDCODE calendar-app)
 
16
 
 
17
if(CLICK_MODE)
 
18
    if(NOT DEFINED BZR_SOURCE)
 
19
                set(BZR_SOURCE "lp:ubuntu-${APP_HARDCODE}")
 
20
                message("-- Setting BZR_SOURCE to ${BZR_SOURCE}")
 
21
    endif(NOT DEFINED BZR_SOURCE)
 
22
    set(CMAKE_INSTALL_PREFIX /)
 
23
    set(CMAKE_INSTALL_BINDIR /)
 
24
        set(DATA_DIR /)
 
25
        set(EXEC "qmlscene %u ${MAIN_QML}")
 
26
        set(DESKTOP_DIR ${DATA_DIR})
 
27
else(CLICK_MODE)
 
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)
 
36
endif(CLICK_MODE)
 
37
 
 
38
file(GLOB_RECURSE I18N_SRC_FILES
 
39
     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
 
40
     rc/**.qml desktop/**.desktop.in)
 
41
list(SORT I18N_SRC_FILES)
 
42
 
 
43
 
 
44
file(GLOB SRC_FILES
 
45
     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
 
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})
 
50
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR})
 
51
 
 
52
# Tests
 
53
enable_testing()
 
54
 
 
55
add_subdirectory(click)
 
56
add_subdirectory(po)
 
57
add_subdirectory(tests)