diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2019-01-08 19:42:00 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-01-09 03:18:48 +0100 |
commit | fb7e1dfc8256f1722ccc8403ad60b393b5ef3a97 (patch) | |
tree | 1f4300bd88fc2d1b38b2b3a1359c7737924b7aeb | |
parent | 33062908346792b84c82119233527ea6567d9fc6 (diff) | |
download | tde-cmake-fb7e1dfc8256f1722ccc8403ad60b393b5ef3a97.tar.gz tde-cmake-fb7e1dfc8256f1722ccc8403ad60b393b5ef3a97.zip |
Update TDEL10n module
+ Add option to determine comments to extract.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | modules/TDEL10n.cmake | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake index 2eaf46f..eab973f 100644 --- a/modules/TDEL10n.cmake +++ b/modules/TDEL10n.cmake @@ -129,6 +129,7 @@ endfunction( ) ##### tde_l10n_create_template( ##### [CATALOG] file_name ##### [SOURCES source_spec [source_spec]] +##### [COMMENT tag] ##### [EXCLUDES regex [regex]] ##### [KEYWORDS keyword [keyword]] ##### [ATTRIBUTES attrib_spec [attrib_spec]] @@ -148,6 +149,7 @@ endfunction( ) ##### 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 +##### COMMENT determines additional comment to extract by xgettext. ##### KEYWORDS determines additional keywords for xgettext. ##### Use "-" if is needed to disable default keywords. ##### ATTRIBUTES determines files and specification for extractattr: @@ -176,6 +178,7 @@ macro( tde_l10n_create_template ) unset( _pots ) unset( _dest ) unset( _keywords_add ) + unset( _comment ) unset( _attributes ) unset( _pot ) unset( _directive ) @@ -213,6 +216,13 @@ macro( tde_l10n_create_template ) set( _directive 1 ) endif( ) + # found directive "COMMENT" + if( "+${_arg}" STREQUAL "+COMMENT" ) + unset( _comment ) + set( _var _comment ) + set( _directive 1 ) + endif( ) + # found directive "KEYWORDS" if( "+${_arg}" STREQUAL "+KEYWORDS" ) unset( _keywords_add ) @@ -331,6 +341,15 @@ macro( tde_l10n_create_template ) tde_message_fatal( "no source files found" ) endif( ) + # prepare comment + if( NOT "${_comment}" STREQUAL "" ) + if( "${_comment}" STREQUAL "-" OR "${_comment}" STREQUAL "all" ) + set( _comment "-c" ) + else( ) + set( _comment "-c${_comment}" ) + endif( ) + endif( ) + # prepare keywords unset( _keywords_c ) unset( _keywords_desktop ) @@ -417,7 +436,7 @@ macro( tde_l10n_create_template ) if( _files ) execute_process( COMMAND ${KDE_XGETTEXT_EXECUTABLE} --foreign-user -C - ${_keywords_c} -o - ${_files} + ${_comment} ${_keywords_c} -o - ${_files} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE _pot ) |