summaryrefslogtreecommitdiff
path: root/po/CMakeLists.txt
diff options
context:
space:
mode:
authoradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-06 23:02:43 +0000
committeradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-06 23:02:43 +0000
commit601ebdf6c4faea76016cf0d87d50abc260ca1569 (patch)
treecf601630c933447f2a369f6245f9a04b9a46b08a /po/CMakeLists.txt
parentTypographical and grammar corrections (diff)
parentEBN Krazy fixes. 1st round.. (diff)
downloadrekonq-601ebdf6c4faea76016cf0d87d50abc260ca1569.tar.xz
Fixing conflicts merging master
git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@964593 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'po/CMakeLists.txt')
-rw-r--r--po/CMakeLists.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt
new file mode 100644
index 00000000..261e9e4c
--- /dev/null
+++ b/po/CMakeLists.txt
@@ -0,0 +1,34 @@
+FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
+
+IF(NOT GETTEXT_MSGFMT_EXECUTABLE)
+ MESSAGE(
+"------
+ NOTE: msgfmt not found. Translations will *not* be installed
+------")
+ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE)
+
+ SET(catalogname rekonq)
+
+ ADD_CUSTOM_TARGET(translations ALL)
+
+ FILE(GLOB PO_FILES ${catalogname}*.po)
+
+ FOREACH(_poFile ${PO_FILES})
+ GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME)
+ STRING(REGEX REPLACE "^${catalogname}_?" "" _langCode ${_poFileName} )
+ STRING(REGEX REPLACE "\\.po$" "" _langCode ${_langCode} )
+
+ IF( _langCode )
+ GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE)
+ SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
+
+ ADD_CUSTOM_COMMAND(TARGET translations
+ COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile}
+ DEPENDS ${_poFile})
+ INSTALL(FILES ${_gmoFile} DESTINATION ${LOCALE_INSTALL_DIR}/${_langCode}/LC_MESSAGES/ RENAME ${catalogname}.mo)
+ ENDIF( _langCode )
+
+ ENDFOREACH(_poFile ${PO_FILES})
+
+ENDIF(NOT GETTEXT_MSGFMT_EXECUTABLE)
+