@ -1,6 +1,6 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
#
# ( C ) 2 0 1 8 S l á v e k B a n k o
# ( C ) 2 0 1 8 - 2 0 1 9 S l á v e k B a n k o
# slavek ( DOT ) banko ( AT ) a x i s . c z
# slavek ( DOT ) banko ( AT ) a x i s . c z
#
#
# I m p r o v e m e n t s a n d f e e d b a c k a r e w e l c o m e
# I m p r o v e m e n t s a n d f e e d b a c k a r e w e l c o m e
@ -29,7 +29,7 @@ if( NOT DEFINED KDE_XGETTEXT_EXECUTABLE )
N A M E S k d e - x g e t t e x t
N A M E S k d e - x g e t t e x t
H I N T S " $ { T D E _ P R E F I X } / b i n "
H I N T S " $ { T D E _ P R E F I X } / b i n "
)
)
if ( NOT KDE_XGETTEXT_EXECUTABLE )
if ( "${KDE_XGETTEXT_EXECUTABLE}" STREQUAL "KDE_XGETTEXT_EXECUTABLE-NOTFOUND" )
tde_message_fatal ( "kde-xgettext is required but not found" )
tde_message_fatal ( "kde-xgettext is required but not found" )
endif ( )
endif ( )
endif ( )
endif ( )
@ -39,7 +39,7 @@ if( NOT DEFINED XGETTEXT_EXECUTABLE )
N A M E S x g e t t e x t
N A M E S x g e t t e x t
H I N T S " $ { T D E _ P R E F I X } / b i n "
H I N T S " $ { T D E _ P R E F I X } / b i n "
)
)
if ( NOT XGETTEXT_EXECUTABLE )
if ( "${XGETTEXT_EXECUTABLE}" STREQUAL "XGETTEXT_EXECUTABLE-NOTFOUND" )
tde_message_fatal ( "xgettext is required but not found" )
tde_message_fatal ( "xgettext is required but not found" )
endif ( )
endif ( )
execute_process (
execute_process (
@ -58,7 +58,7 @@ if( NOT DEFINED MSGUNIQ_EXECUTABLE )
N A M E S m s g u n i q
N A M E S m s g u n i q
H I N T S " $ { T D E _ P R E F I X } / b i n "
H I N T S " $ { T D E _ P R E F I X } / b i n "
)
)
if ( NOT MSGUNIQ_EXECUTABLE )
if ( "${MSGUNIQ_EXECUTABLE}" STREQUAL "MSGUNIQ_EXECUTABLE-NOTFOUND" )
tde_message_fatal ( "msguniq is required but not found" )
tde_message_fatal ( "msguniq is required but not found" )
endif ( )
endif ( )
endif ( )
endif ( )
@ -68,7 +68,7 @@ if( NOT DEFINED MSGCAT_EXECUTABLE )
N A M E S m s g c a t
N A M E S m s g c a t
H I N T S " $ { T D E _ P R E F I X } / b i n "
H I N T S " $ { T D E _ P R E F I X } / b i n "
)
)
if ( NOT MSGCAT_EXECUTABLE )
if ( "${MSGCAT_EXECUTABLE}" STREQUAL "MSGCAT_EXECUTABLE-NOTFOUND" )
tde_message_fatal ( "msgcat is required but not found" )
tde_message_fatal ( "msgcat is required but not found" )
endif ( )
endif ( )
endif ( )
endif ( )
@ -78,7 +78,7 @@ if( NOT DEFINED PO4A_GETTEXTIZE_EXECUTABLE )
N A M E S p o 4 a - g e t t e x t i z e
N A M E S p o 4 a - g e t t e x t i z e
H I N T S " $ { T D E _ P R E F I X } / b i n "
H I N T S " $ { T D E _ P R E F I X } / b i n "
)
)
if ( NOT PO4A_GETTEXTIZE_EXECUTABLE )
if ( "${PO4A_GETTEXTIZE_EXECUTABLE}" STREQUAL "PO4A_GETTEXTIZE_EXECUTABLE-NOTFOUND" )
tde_message_fatal ( "po4a-gettextize is required but not found" )
tde_message_fatal ( "po4a-gettextize is required but not found" )
endif ( )
endif ( )
execute_process (
execute_process (
@ -92,6 +92,22 @@ if( NOT DEFINED PO4A_GETTEXTIZE_EXECUTABLE )
endif ( )
endif ( )
endif ( )
endif ( )
if ( NOT DEFINED TDE_COMMON_TEXTS_POT )
get_filename_component ( TDE_SOURCE_BASE "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE )
while ( ( NOT EXISTS "${TDE_SOURCE_BASE}/tdelibs"
O R N O T I S _ D I R E C T O R Y " $ { T D E _ S O U R C E _ B A S E } / t d e l i b s " )
A N D N O T " $ { T D E _ S O U R C E _ B A S E } " S T R E Q U A L " / " )
get_filename_component ( TDE_SOURCE_BASE "${TDE_SOURCE_BASE}" PATH )
endwhile ( )
find_file ( TDE_COMMON_TEXTS_POT
N A M E S t d e . p o t
H I N T S " $ { T D E _ S O U R C E _ B A S E } / t d e l i b s " " $ { T D E _ P R E F I X } / i n c l u d e " " $ { T D E _ P R E F I X } / i n c l u d e / t d e "
)
if ( "${TDE_COMMON_TEXTS_POT}" STREQUAL "TDE_COMMON_TEXTS_POT-NOTFOUND" )
tde_message_fatal ( "translation template with common texts not found" )
endif ( )
endif ( )
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # #
# # # # #
@ -142,6 +158,7 @@ endfunction( )
# # # # # [ E X C L U D E S r e g e x [ r e g e x ] ]
# # # # # [ E X C L U D E S r e g e x [ r e g e x ] ]
# # # # # [ K E Y W O R D S k e y w o r d [ k e y w o r d ] ]
# # # # # [ K E Y W O R D S k e y w o r d [ k e y w o r d ] ]
# # # # # [ A T T R I B U T E S a t t r i b _ s p e c [ a t t r i b _ s p e c ] ]
# # # # # [ A T T R I B U T E S a t t r i b _ s p e c [ a t t r i b _ s p e c ] ]
# # # # # [ X - P O T c o m m o n _ t e x t s . p o t ]
# # # # # [ D E S T I N A T I O N d i r e c t o r y ]
# # # # # [ D E S T I N A T I O N d i r e c t o r y ]
# # # # # )
# # # # # )
# # # # #
# # # # #
@ -163,6 +180,9 @@ endfunction( )
# # # # # U s e " - " i f i s n e e d e d t o d i s a b l e d e f a u l t k e y w o r d s .
# # # # # U s e " - " i f i s n e e d e d t o d i s a b l e d e f a u l t k e y w o r d s .
# # # # # A T T R I B U T E S d e t e r m i n e s f i l e s a n d s p e c i f i c a t i o n f o r e x t r a c t a t t r :
# # # # # A T T R I B U T E S d e t e r m i n e s f i l e s a n d s p e c i f i c a t i o n f o r e x t r a c t a t t r :
# # # # # s o u r c e _ s p e c : e l e m e n t , a t t r i b u t e [ , c o n t e x t ] [ [ : e l e m e n t , a t t r i b u t e [ , c o n t e x t ] ] . . . ]
# # # # # s o u r c e _ s p e c : e l e m e n t , a t t r i b u t e [ , c o n t e x t ] [ [ : e l e m e n t , a t t r i b u t e [ , c o n t e x t ] ] . . . ]
# # # # # X - P O T e n t r i e s f r o m c o m m o n _ t e x t s . p o t a r e n o t e x t r a c t e d
# # # # # B y d e f a u l t , " t d e . p o t " i s s e a r c h e d f o r a n d u s e d .
# # # # # U s e " - " t o s k i p t h i s .
# # # # # D E S T I N A T I O N d e t e r m i n e s d i r e c t o r y t o s a v e t r a n s l a t i o n t e m p l a t e .
# # # # # D E S T I N A T I O N d e t e r m i n e s d i r e c t o r y t o s a v e t r a n s l a t i o n t e m p l a t e .
# # # # # T h e d e s t i n a t i o n d i r e c t o r y i s d e t e r m i n e d a s f o l l o w s :
# # # # # T h e d e s t i n a t i o n d i r e c t o r y i s d e t e r m i n e d a s f o l l o w s :
# # # # # a ) D i r e c t o r y i s s p e c i f i e d a s a n a r g u m e n t .
# # # # # a ) D i r e c t o r y i s s p e c i f i e d a s a n a r g u m e n t .
@ -189,6 +209,7 @@ macro( tde_l10n_create_template )
unset ( _keywords_add )
unset ( _keywords_add )
unset ( _comment )
unset ( _comment )
unset ( _attributes )
unset ( _attributes )
unset ( _exclude_pot )
unset ( _pot )
unset ( _pot )
unset ( _directive )
unset ( _directive )
set ( _var _catalog )
set ( _var _catalog )
@ -246,6 +267,13 @@ macro( tde_l10n_create_template )
set ( _directive 1 )
set ( _directive 1 )
endif ( )
endif ( )
# f o u n d d i r e c t i v e " X - P O T "
if ( "+${_arg}" STREQUAL "+X-POT" )
unset ( _exclude_pot )
set ( _var _exclude_pot )
set ( _directive 1 )
endif ( )
# c o l l e c t d a t a
# c o l l e c t d a t a
if ( _directive )
if ( _directive )
unset ( _directive )
unset ( _directive )
@ -340,6 +368,19 @@ macro( tde_l10n_create_template )
tde_message_fatal ( "no source files found" )
tde_message_fatal ( "no source files found" )
endif ( )
endif ( )
# p r e p a r e x - p o t
if ( NOT _exclude_pot )
set ( _exclude_pot "${TDE_COMMON_TEXTS_POT}" )
endif ( )
if ( "${_exclude_pot}" STREQUAL "-" )
unset ( _exclude_pot )
else ( )
if ( ${ _exclude_pot } MATCHES "^[^/]" )
set ( _exclude_pot "${CMAKE_CURRENT_SOURCE_DIR}/${_exclude_pot}" )
endif ( )
set ( _exclude_pot "-x${_exclude_pot}" )
endif ( )
# p r e p a r e c o m m e n t
# p r e p a r e c o m m e n t
if ( NOT "${_comment}" STREQUAL "" )
if ( NOT "${_comment}" STREQUAL "" )
if ( "${_comment}" STREQUAL "-" OR "${_comment}" STREQUAL "all" )
if ( "${_comment}" STREQUAL "-" OR "${_comment}" STREQUAL "all" )
@ -497,7 +538,7 @@ macro( tde_l10n_create_template )
if ( _files )
if ( _files )
execute_process (
execute_process (
C O M M A N D $ { K D E _ X G E T T E X T _ E X E C U T A B L E } - - f o r e i g n - u s e r - C
C O M M A N D $ { K D E _ X G E T T E X T _ E X E C U T A B L E } - - f o r e i g n - u s e r - C
$ { _ c o m m e n t } $ { _ k e y w o r d s _ c } -o - $ { _ f i l e s }
$ { _ c o m m e n t } $ { _ k e y w o r d s _ c } ${ _ e x c l u d e _ p o t } -o - $ { _ f i l e s }
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R }
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R }
O U T P U T _ V A R I A B L E _ p o t
O U T P U T _ V A R I A B L E _ p o t
)
)