GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

CMakeLists.txt 3.57 KB
Newer Older
1
# Geary build script
2
# Copyright 2011-2013 Yorba Foundation
3 4 5 6 7 8
#
# Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation

cmake_minimum_required(VERSION 2.8)
cmake_policy(VERSION 2.6)

9
project(geary C)
10 11 12 13 14 15 16

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )

#
# Base bits
#
set(GETTEXT_PACKAGE "geary")
17
set(RELEASE_NAME "Lightweight email client for GNOME.")
Charles Lindsay's avatar
Charles Lindsay committed
18
set(VERSION "0.4.0pr1")
19
set(VERSION_INFO "Release")
20
set(LANGUAGE_SUPPORT_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/locale)
21

22 23 24 25 26
# Packaging filenamesnames.
set(ARCHIVE_BASE_NAME ${CMAKE_PROJECT_NAME}-${VERSION})
set(ARCHIVE_FULL_NAME ${ARCHIVE_BASE_NAME}.tar.xz)
set(ARCHIVE_DEBUILD_FULL_NAME ${CMAKE_PROJECT_NAME}_${VERSION}.orig.tar.xz)

27 28
set(GLADE_FILES ui/account_list.glade ui/account_cannot_remove.glade ui/account_spinner.glade
    ui/composer.glade ui/login.glade ui/message.glade ui/password-dialog.glade ui/preferences.glade
29
    ui/remove_confirm.glade)
30

31
option(DEBUG "Build for debugging." OFF)
32 33
option(ICON_UPDATE "Run gtk-update-icon-cache after the install." ON)
option(DESKTOP_UPDATE "Run update-desktop-database after the install." ON)
34
option(DESKTOP_VALIDATE "Check generated desktop file for errors during build." ON)
35

36 37 38 39
if (DEBUG)
    message(STATUS "Debug build")
endif ()

40 41 42 43 44 45 46 47
if (ICON_UPDATE)
    message(STATUS "Icon cache will be updated")
endif ()

if (DESKTOP_UPDATE)
    message(STATUS "Desktop database will be updated")
endif ()

48 49 50 51
if (DESKTOP_VALIDATE)
    message(STATUS "Generated desktop file will be checked for errors")
endif ()

52 53
find_package(PkgConfig)
pkg_check_modules(LIBUNITY QUIET unity>=5.12.0)
54
pkg_check_modules(LIBMESSAGINGMENU QUIET messaging-menu>=12.10.2)
55

Jim Nelson's avatar
Jim Nelson committed
56 57 58 59 60 61 62
# intl
include(Gettext)
if (XGETTEXT_FOUND)
    message(STATUS "xgettext found")
else ()
    message(STATUS "xgettext not found")
endif ()
63

64 65 66 67 68 69 70 71 72 73
#
# Uninstall target
#
configure_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
    IMMEDIATE @ONLY
)

add_custom_target(
74
    uninstall-base
75 76 77 78 79 80
    COMMAND 
        ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
    COMMAND 
        ${glib_schema_compiler} ${GSETTINGS_DIR}
)

81 82 83 84 85 86 87 88
add_custom_target(
    uninstall
)

# We add this dependency using add_dependencies (which makes it run first) rather than
# a depends clause in add_custom_target (which would make it run last).
add_dependencies(uninstall uninstall-base)

89 90 91 92 93 94
# This gets fired in the root-level Makefile to ensure an post-uninstall cleanup happens after
# everything has has been removed
add_custom_target(
    post-uninstall
)

Eric Gregory's avatar
Eric Gregory committed
95 96
# Dist
# This generates the dist tarballs
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
add_custom_target(
    dist
    COMMAND 
        git archive --prefix=${ARCHIVE_BASE_NAME}/ HEAD
        | xz -z > ${CMAKE_BINARY_DIR}/${ARCHIVE_FULL_NAME}
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)

# Ubuntu
# Builds the source Debian package used for the Launchpad PPA
add_custom_target(
    ubuntu_pre
    DEPENDS
        dist
    COMMAND 
        ${CMAKE_COMMAND} -E copy ${ARCHIVE_FULL_NAME} ${ARCHIVE_DEBUILD_FULL_NAME}
    COMMAND
        tar xvfx ${ARCHIVE_FULL_NAME}
)

add_custom_target(
    ubuntu
    DEPENDS
        ubuntu_pre
    COMMAND
        ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/debian" 
        "${CMAKE_CURRENT_BINARY_DIR}/${ARCHIVE_BASE_NAME}/debian"
    COMMAND 
        debuild -S -k$ENV{GPGKEY}
    COMMAND

    WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${ARCHIVE_BASE_NAME}"
)
Eric Gregory's avatar
Eric Gregory committed
130

131 132 133
add_subdirectory(desktop)
add_subdirectory(help)
add_subdirectory(icons)
134
add_subdirectory(po)
135 136 137 138 139
add_subdirectory(sql)
add_subdirectory(src)
add_subdirectory(theming)
add_subdirectory(ui)