diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2018-12-09 01:24:25 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-12-09 01:24:25 +0100 |
commit | 4eb308f914eadca83ecc97c86ab2bb5355656539 (patch) | |
tree | b7c606d3583d08b6efb1718e71e4d57cb3d3410f | |
parent | 0f348d894e09f08c9caf1c363fb48b61efec7e0f (diff) | |
download | tde-cmake-4eb308f9.tar.gz tde-cmake-4eb308f9.zip |
Update TDEL10n module
+ Little modification in code formatting.
+ Added comment about editing the list inside foreach.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | modules/TDEL10n.cmake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake index 9702553..dfafa1b 100644 --- a/modules/TDEL10n.cmake +++ b/modules/TDEL10n.cmake @@ -155,6 +155,12 @@ endfunction( ) ##### source_spec:element,attribute[,context] ##### DESTINATION determines directory to save translation template. ##### +##### Note: +##### Editing the _files list inside foreach( ${_files} ) below in the +##### code is safe, because in CMake foreach parameters are evaluated +##### before the loop starts. Therefore, the changes in the list inside +##### the loop do not have an unwanted impact on the loop processing. +##### macro( tde_l10n_create_template ) @@ -278,8 +284,9 @@ macro( tde_l10n_create_template ) endif( ) endforeach( ) + + # add common translator info if( _files ) - # add common translator info set( _translatorinfo "i18n(\"NAME OF TRANSLATORS\", \"Your names\")\n" "i18n(\"EMAIL OF TRANSLATORS\", \"Your emails\")\n" @@ -287,8 +294,9 @@ macro( tde_l10n_create_template ) file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/_translatorinfo.tde_l10n ${_translatorinfo} ) list( INSERT _files 0 "_translatorinfo.tde_l10n" ) endif( ) + + # filter files by excludes if( _excludes ) - # filter files by excludes foreach( _src ${_files} ) foreach( _exclude ${_excludes} ) if( ${_src} MATCHES ${_exclude} ) |