summaryrefslogtreecommitdiffstats
path: root/po/CMakeLists.txt
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2018-09-29 20:26:11 +0000
committerEduard Braun <eduard.braun2@gmx.de>2018-09-29 20:26:22 +0000
commite939fcccf36f2a89435b0f8328db9be32ce3b600 (patch)
tree7a2faa9fea485d6e59be1897f4a43423930b1455 /po/CMakeLists.txt
parentCMake: Whitespace cleanup (diff)
downloadinkscape-e939fcccf36f2a89435b0f8328db9be32ce3b600.tar.gz
inkscape-e939fcccf36f2a89435b0f8328db9be32ce3b600.zip
CMake/po: Check for presence of intltool for creating inkscape.pot
Also remove FindGettext module and use the one that ships with CMake (bumps minimum version to CMake 2.8.8 for GETTEXT_VERSION_STRING)
Diffstat (limited to 'po/CMakeLists.txt')
-rw-r--r--po/CMakeLists.txt45
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()