~ubuntu-branches/ubuntu/saucy/darktable/saucy

« back to all changes in this revision

Viewing changes to doc/usermanual/po/CMakeLists.txt

  • Committer: Bazaar Package Importer
  • Author(s): David Bremner
  • Date: 2011-07-12 09:36:46 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110712093646-yp9dbxan44dmw15h
Tags: 0.9-1
* New upstream release.
* Remove all patches now upstream; only patch for
  -Wno-error=unused-but-set-variable remains.
* Bump Standards-Version to 3.9.2 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
cmake_minimum_required(VERSION 2.6)
2
 
 
3
 
set(can_update_usermanual ON)
4
 
 
5
 
find_program(Xsltproc_BIN xsltproc)
6
 
find_program(Xml2po_BIN xml2po)
7
 
 
8
 
if(${Xsltproc_BIN} STREQUAL "Xsltproc_BIN-NOTFOUND")
9
 
        message("Missing xsltproc")
10
 
        set(can_update_usermanual OFF)
11
 
endif()
12
 
 
13
 
if(${Xml2po_BIN} STREQUAL "Xml2po_BIN-NOTFOUND")
14
 
        message("Missing xml2po")
15
 
        set(can_update_usermanual OFF)
16
 
endif()
17
 
 
18
 
if(can_update_usermanual )
19
 
 
20
 
        add_custom_target(update-usermanual)
21
 
 
22
 
        # update template
23
 
        add_custom_command(
24
 
                OUTPUT darktable-usermanual.pot
25
 
                COMMAND xsltproc --output ${CMAKE_CURRENT_BINARY_DIR}/darktable-usermanual_profiled_final.xml ../xsl/darktable_profile.xsl ../darktable.xml 
26
 
                COMMAND xml2po -a -e -o darktable-usermanual.pot ${CMAKE_CURRENT_BINARY_DIR}/darktable-usermanual_profiled_final.xml
27
 
                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
28
 
                DEPENDS ../darktable.xml ../xsl/darktable_profile.xsl
29
 
                COMMENT "Updating usermanual template" VERBATIM
30
 
        )
31
 
        add_custom_target(update-template DEPENDS darktable-usermanual.pot)
32
 
 
33
 
        # localized final usermanuals
34
 
        file(STRINGS "LINGUAS" LANGUAGES)
35
 
        foreach(language ${LANGUAGES})
36
 
                set(pofile "${language}.po")
37
 
                add_custom_command(
38
 
                        OUTPUT ${pofile}
39
 
                        COMMAND sh -c "if test ! -f ${pofile}; then ${CMAKE_COMMAND} -E copy darktable-usermanual.pot ${pofile}; fi"
40
 
                        COMMAND xml2po -a -e -u ${pofile} ${CMAKE_CURRENT_BINARY_DIR}/darktable-usermanual_profiled_final.xml
41
 
                        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
42
 
                        COMMENT "Updating ${language} usermanual pofile" VERBATIM
43
 
                )
44
 
                add_custom_target(update-usermanual-${language} DEPENDS darktable-usermanual.pot ${pofile})
45
 
                add_dependencies(update-usermanual update-usermanual-${language})
46
 
        endforeach(language)
47
 
 
48
 
else(can_update_usermanual )
49
 
        message("Can NOT update usermanual")
50
 
endif(can_update_usermanual )