Update TDEL10n module

+ Added option to exclude files from processing.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 13a14899d5)
r14.0.x
Slávek Banko 6 years ago
parent bb13efcd1a
commit ef3050859d
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -131,6 +131,7 @@ endfunction( )
##### tde_create_l10n_template(
##### CATALOG file_name
##### [SOURCES source_spec [source_spec]]
##### [EXCLUDES regex [regex]]
##### [KEYWORDS keyword [keyword]]
##### [ATTRIBUTES attrib_spec [attrib_spec]]
##### [DESTINATION directory]
@ -148,6 +149,7 @@ endfunction( )
##### - all files with the specified mask will be searched.
##### d) Specify the name of the individual file.
##### The methods from b) to d) can be combined.
##### EXCLUDES determines which files are to be excluded from processing
##### KEYWORDS determines additional keywords for xgettext.
##### ATTRIBUTES determines files and specification for extractattr:
##### source_spec:element,attribute[,context]
@ -158,6 +160,7 @@ macro( tde_create_l10n_template )
unset( _catalog )
unset( _sources )
unset( _excludes )
unset( _files )
unset( _rcs )
unset( _desktops )
@ -184,6 +187,13 @@ macro( tde_create_l10n_template )
set( _directive 1 )
endif( )
# found directive "EXCLUDES"
if( "+${_arg}" STREQUAL "+EXCLUDES" )
unset( _excludes )
set( _var _excludes )
set( _directive 1 )
endif( )
# found directive "DESTINATION"
if( "+${_arg}" STREQUAL "+DESTINATION" )
unset( _dest )
@ -268,6 +278,16 @@ macro( tde_create_l10n_template )
endif( )
endforeach( )
if( _excludes )
# filter files by excludes
foreach( _src ${_files} )
foreach( _exclude ${_excludes} )
if( ${_src} MATCHES ${_exclude} )
list( REMOVE_ITEM _files ${_src} )
endif( )
endforeach( )
endforeach( )
endif( )
if( NOT _files AND NOT _attributes )
tde_message_fatal( "no source files found" )
endif( )

Loading…
Cancel
Save