Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / po / CMakeLists.txt
index 23cf304..977fdc0 100644 (file)
@@ -1,37 +1,18 @@
-# Translation set name
-SET( POT_NAME "zypp" )
-
-SET( POT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${POT_NAME}.pot )
-SET( NEW_POT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${POT_NAME}.pot )
-
-FILE( GLOB PO_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.po" )
-
-# Provides the 'translations' target that
-# creates the .gmo files out of the .po files
-GETTEXT_CREATE_TRANSLATIONS( ${POT_FILE} "ALL" ${PO_FILES} )
-
-# Creating the .pot file and preparing the .po files.
-# POT_FILE_DEPENDS was set in ../src
-# Don't update for changed line numbers only.
-SET( XGETTEXT_CMD "xgettext" )
-SET( XGETTEXT_OPTIONS -L C++ --boost --no-wrap --add-comments --add-location --foreign-user )
-SET( XGETTEXT_OPTIONS ${XGETTEXT_OPTIONS} --keyword=_ --keyword=_:1,2 --keyword=__ --keyword=N_ --keyword=PL_:1,2 )
-SET( XGETTEXT_OPTIONS ${XGETTEXT_OPTIONS} --copyright-holder=\"SuSE Linux GmbH, Nuernberg\" )
-SET( XGETTEXT_OPTIONS ${XGETTEXT_OPTIONS} --package-name=${POT_NAME} --default-domain=${POT_NAME} )
-
-ADD_CUSTOM_COMMAND( OUTPUT ${NEW_POT_FILE}
-  COMMAND ${XGETTEXT_CMD} ${XGETTEXT_OPTIONS} --output=${NEW_POT_FILE} ${POT_FILE_DEPENDS}
-  WORKING_DIRECTORY ${LIBZYPP_SOURCE_DIR}
-  COMMENT "Extract translatable messages to ${NEW_POT_FILE}"
+#
+# Creating the .pot file to be translated.
+#
+ADD_CUSTOM_TARGET( zypp.pot
+       COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/createPot ${LIBZYPP_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/zypp.pot
 )
-
-ADD_CUSTOM_COMMAND( OUTPUT ${POT_FILE}
-  COMMAND diff -u -I ^\#: -I ^.POT-Creation-Date: ${POT_FILE} ${NEW_POT_FILE} || cp -v ${NEW_POT_FILE} ${POT_FILE} && touch -t 200001010000 ${NEW_POT_FILE}
-  DEPENDS ${NEW_POT_FILE}
-  COMMENT "Update translatable messages in ${POT_FILE}"
+SET_DIRECTORY_PROPERTIES( PROPERTIES
+       ADDITIONAL_MAKE_CLEAN_FILES zypp.pot
 )
 
-ADD_CUSTOM_TARGET( potfile
-  COMMAND rm -f ${NEW_POT_FILE}
-  COMMAND make translations
-)
+#
+# Provides the 'translations' target that creates the .gmo files
+# out of the pofiles provided by zypp-po.tar.bz2.
+# Use USE_TRANSLATION_SET to use an alternate set provided by
+# ${USE_TRANSLATION_SET}-po.tar.bz2
+#
+GETTEXT_CREATE_TARBALL_TRANSLATIONS( "zypp" )
+