From de28678da93dc8080746c1a67a7514dad4eb437c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 5 Dec 2018 01:42:40 +0100 Subject: [PATCH] Update TDEL10n module + Added option to exclude files from processing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 13a14899d50fbb99601cd0e83ae0d20ab46a404d) --- modules/TDEL10n.cmake | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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( )