diff options
Diffstat (limited to 'po/CMakeLists.txt')
| -rw-r--r-- | po/CMakeLists.txt | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index ce9a03ca2..94625e4da 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -1,18 +1,16 @@ +# process and install .po files file(GLOB LANGUAGES *.po) foreach(language ${LANGUAGES}) - string(REGEX REPLACE "(.+(\\\\|/))+" "" language ${language}) - string(REGEX REPLACE "\\.po$" "" language ${language}) - set(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${language}.po) - GETTEXT_PROCESS_PO_FILES(${language} ALL INSTALL_DESTINATION "share/locale/" PO_FILES ${pofile}) + string(REGEX REPLACE "(.+(\\\\|/))+" "" language ${language}) + string(REGEX REPLACE "\\.po$" "" language ${language}) + set(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${language}.po) + GETTEXT_PROCESS_PO_FILES(${language} ALL INSTALL_DESTINATION "share/locale/" PO_FILES ${pofile}) endforeach(language) -if(NOT WIN32) -#translates inkscape.desktop -add_custom_target(inkscape_desktop DEPENDS ${CMAKE_BINARY_DIR}/inkscape.desktop) - -if(${GETTEXT_VERSION_STRING} VERSION_GREATER "0.19") - add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/inkscape.desktop +# translate inkscape.desktop +if("${GETTEXT_VERSION_STRING}" VERSION_GREATER "0.19") + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/inkscape.desktop DEPENDS ${LANGUAGES} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --desktop --template ${CMAKE_SOURCE_DIR}/inkscape.desktop.template -d ${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_BINARY_DIR}/inkscape.desktop.template.in --keyword=Name --keyword=GenericName --keyword=X-GNOME-FullName --keyword=Comment --keyword=Keywords COMMAND ${CMAKE_COMMAND} -DINKSCAPE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DINKSCAPE_BINARY_DIR=${CMAKE_BINARY_DIR} -DENABLE_BINRELOC=${ENABLE_BINRELOC} -P ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-desktop.cmake @@ -24,20 +22,21 @@ else() COMMAND ${CMAKE_COMMAND} -DINKSCAPE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DINKSCAPE_BINARY_DIR=${CMAKE_BINARY_DIR} -DENABLE_BINRELOC=${ENABLE_BINRELOC} -P ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-desktop.cmake ) endif() +add_custom_target(inkscape_desktop ALL DEPENDS ${CMAKE_BINARY_DIR}/inkscape.desktop) -add_dependencies(inkscape inkscape_desktop) -add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/inkscape.pot - COMMAND intltool-update --pot && mv untitled.pot ${CMAKE_CURRENT_SOURCE_DIR}/inkscape.pot - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) -set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/inkscape.pot PROPERTIES GENERATED TRUE) -add_custom_target(inkscape_pot ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/inkscape.pot) -add_dependencies(inkscape_pot filters_svg_h) -add_dependencies(inkscape_pot palettes_h) -add_dependencies(inkscape_pot patterns_svg_h) -add_dependencies(inkscape_pot symbols_h) -add_dependencies(inkscape_pot templates_h) +# update inkscape.pot +if(INTLTOOL-UPDATE) + add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/inkscape.pot + COMMAND sh -c "${INTLTOOL-UPDATE} --pot && mv untitled.pot ${CMAKE_CURRENT_SOURCE_DIR}/inkscape.pot" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/inkscape.pot PROPERTIES GENERATED TRUE) + add_custom_target(inkscape_pot ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/inkscape.pot) + add_dependencies(inkscape_pot filters_svg_h) + add_dependencies(inkscape_pot palettes_h) + add_dependencies(inkscape_pot patterns_svg_h) + add_dependencies(inkscape_pot symbols_h) + add_dependencies(inkscape_pot templates_h) endif() |
