summaryrefslogtreecommitdiffstats
path: root/CMakeL10n.txt
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-12-02 16:47:00 +0100
committerTDE Gitea <gitea@mirror.git.trinitydesktop.org>2018-12-09 15:42:12 +0000
commite532d9345d1568c348ad45ffd7beb8e8a79361b7 (patch)
tree9ae1ca459330756a5f2b621f3124f6eacd2897a5 /CMakeL10n.txt
parent7ef585492cbe3a421bee00898b3927a88e035094 (diff)
downloadtdelibs-e532d9345d1568c348ad45ffd7beb8e8a79361b7.tar.gz
tdelibs-e532d9345d1568c348ad45ffd7beb8e8a79361b7.zip
Add CMakeL10n rules.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'CMakeL10n.txt')
-rw-r--r--CMakeL10n.txt96
1 files changed, 96 insertions, 0 deletions
diff --git a/CMakeL10n.txt b/CMakeL10n.txt
new file mode 100644
index 000000000..bc73da47d
--- /dev/null
+++ b/CMakeL10n.txt
@@ -0,0 +1,96 @@
+#################################################
+#
+# (C) 2018 Slávek Banko
+# slavek.banko (AT) axis.cz
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+cmake_minimum_required( VERSION 2.8 )
+
+
+##### include our cmake modules #################
+
+set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
+include( TDEL10n )
+
+
+##### set directory for POT files ###############
+
+set( POT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../tde-i18n/template/messages/tdelibs" )
+
+
+##### verify tqt3 sources #######################
+
+if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src )
+ tde_message_fatal( "TQt3 source code is required but not found" )
+endif( )
+
+
+##### prepare tqt3/src/xml/qxml.cpp #############
+
+if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp )
+ # hide "#define" to allow strings to be extracted using xgettext
+ file( READ ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp _tqt_qxml )
+ string( REGEX REPLACE "\n(#define[^\n]*)(QT_TRANSLATE_NOOP)" "\n/*\\1*/\\2" _tqt_qxml ${_tqt_qxml} )
+ file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/tqt3/src/xml/qxml.cpp.tde_l10n "${_tqt_qxml}" )
+endif( )
+
+
+##### generate tdeabc/addressee files ###########
+
+execute_process(
+ COMMAND perl ./makeaddressee
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/scripts
+)
+
+
+##### create translation templates ##############
+
+tde_l10n_create_template(
+ CATALOG "tdelibs"
+ SOURCES
+ "."
+ "tdecore/tde-config.cpp.cmake"
+ "../dependencies/tqt3/src"
+ "../dependencies/tqt3/src/xml/qxml.cpp.tde_l10n"
+ EXCLUDES
+ "/test/" "/tests/"
+ "^arts/kde/mcop-dcop/"
+ "^arts/knotify/"
+ "^interfaces/tdemediaplayer/tdefileaudiopreview/"
+ "^kate/"
+ "^kdoctools/"
+ "^libtdescreensaver/"
+ "^tdeabc/formats/"
+ "^tdeabc/plugins/"
+ "^tdecmshell/"
+ "^tdecore/tdeconfig_compiler/example/"
+ "^tdeio/"
+ "^tdeioslave/"
+ "^tdeprint/"
+ "^tdeui/colors/"
+ "^tdestyles/.*/config/"
+ "/dependencies/tqt3/src/xml/qxml.cpp$"
+ KEYWORDS
+ tr tr:1,2
+ translate translate:1,2
+ QT_TRANSLATE_NOOP QT_TRANSLATE_NOOP:1,2
+)
+
+
+##### clenaup tdeabc/addressee files ############
+
+file( REMOVE
+ ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/addressee.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/addressee.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/tdeabc/field.cpp
+)
+
+
+##### create translation templates ##############
+
+tde_l10n_auto_add_subdirectories( )