~midori/midori/trunk

6350.2.13 by Christian Dywan
Merge translations into .desktop files
1
# FindIntltool.cmake
2
#
3
# Jim Nelson <jim@yorba.org>
4
# Copyright 2012-2013 Yorba Foundation
5
# Copyright (C) 2013 Christian Dywan
6
7
find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge)
6350.2.14 by Christian Dywan
Add pot target to update translation template
8
find_program (INTLTOOL_UPDATE_EXECUTABLE intltool-update)
6350.2.13 by Christian Dywan
Merge translations into .desktop files
9
10
if (INTLTOOL_MERGE_EXECUTABLE)
11
    set (INTLTOOL_MERGE_FOUND TRUE)
12
    macro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
13
        add_custom_target ("${desktop_id}.desktop" ALL
14
            ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir}
15
                ${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.desktop.in ${desktop_id}.desktop
16
        )
6350.2.15 by Christian Dywan
Fix quoting of desktop source and install path in FindIntltool
17
        install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${desktop_id}.desktop"
18
                 DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
6350.2.13 by Christian Dywan
Merge translations into .desktop files
19
    endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
6382.1.1 by Christian Dywan
Provide and install .appdata.xml file for app stores
20
    macro (INTLTOOL_MERGE_APPDATA desktop_id po_dir)
21
        add_custom_target ("${desktop_id}.appdata.xml" ALL
22
            ${INTLTOOL_MERGE_EXECUTABLE} --xml-style ${CMAKE_SOURCE_DIR}/${po_dir}
23
                ${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.appdata.xml.in ${desktop_id}.appdata.xml
24
        )
25
        install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${desktop_id}.appdata.xml"
26
                 DESTINATION "${CMAKE_INSTALL_PREFIX}/share/appdata")
27
         endmacro (INTLTOOL_MERGE_APPDATA desktop_id po_dir)
6350.2.13 by Christian Dywan
Merge translations into .desktop files
28
endif ()
6350.2.14 by Christian Dywan
Add pot target to update translation template
29
30
if (INTLTOOL_UPDATE_EXECUTABLE)
31
    set (INTLTOOL_UPDATE_FOUND TRUE)
32
    add_custom_target (pot
33
        COMMAND ${INTLTOOL_UPDATE_EXECUTABLE} "-p" "-g" ${GETTEXT_PACKAGE}
34
        WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/po"
35
        )
36
endif ()
37
38