summaryrefslogtreecommitdiffstats
path: root/modules/TDEL10n.cmake
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-12-05 01:42:40 +0100
committerSlávek Banko <slavek.banko@axis.cz>2018-12-05 01:42:40 +0100
commit13a14899d50fbb99601cd0e83ae0d20ab46a404d (patch)
tree186acba103165f989f808ec9b625442c5c498d69 /modules/TDEL10n.cmake
parent451ca41345a5fea5539f95829026cee9cb3ad118 (diff)
downloadtde-cmake-13a14899d50fbb99601cd0e83ae0d20ab46a404d.tar.gz
tde-cmake-13a14899d50fbb99601cd0e83ae0d20ab46a404d.zip
Update TDEL10n module
+ Added option to exclude files from processing. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'modules/TDEL10n.cmake')
-rw-r--r--modules/TDEL10n.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake
index badb153..084e8f9 100644
--- a/modules/TDEL10n.cmake
+++ b/modules/TDEL10n.cmake
@@ -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( )