diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-05-03 01:18:06 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-05-07 14:38:07 +0200 |
commit | 6b58614fc45d23e442c2c1f468dc51c239ce38b4 (patch) | |
tree | 7bc7f392bf1aa1aed6f3c5f33b0ed50471d8d0d4 | |
parent | 51ace81f2019ee874a4431a55aa0ea85eba1a675 (diff) | |
download | tde-cmake-6b58614fc45d23e442c2c1f468dc51c239ce38b4.tar.gz tde-cmake-6b58614fc45d23e442c2c1f468dc51c239ce38b4.zip |
tde_create_translated_desktop: Allow spaces around the equal sign.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit e8a95f169ebebc7d4aa0350cb059f8e5b0fcb018)
-rw-r--r-- | modules/TDEL10n.cmake | 4 | ||||
-rw-r--r-- | modules/TDEMacros.cmake | 15 |
2 files changed, 9 insertions, 10 deletions
diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake index 9a6053f..1f7df76 100644 --- a/modules/TDEL10n.cmake +++ b/modules/TDEL10n.cmake @@ -1253,9 +1253,9 @@ function( tde_l10n_prepare_desktop ) math( EXPR _desktop_pos "${_desktop_pos}+1" ) # process line - if( "${_desktop_line}" MATCHES "^${_keywords_match}=" ) + if( "${_desktop_line}" MATCHES "^${_keywords_match}[ ]*=" ) string( REGEX REPLACE "\\\"" "\\\\\"" _desktop_line "${_desktop_line}" ) - string( REGEX REPLACE "^${_keywords_match}=([^\n]*)" "/*\\1*/i18n(\"\\2\");" _desktop_line "${_desktop_line}" ) + string( REGEX REPLACE "^${_keywords_match}[ ]*=[ ]*([^\n]*)" "/*\\1*/i18n(\"\\2\");" _desktop_line "${_desktop_line}" ) else( ) set( _desktop_line "" ) endif( ) diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index e4a0397..b451731 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -1735,7 +1735,7 @@ macro( tde_create_translated_desktop ) # create template for intltool-merge file( READ ${_src} _src_data ) string( REPLACE ";" "|" _keywords_match "(${_keywords_desktop})" ) - string( REGEX REPLACE "(^|\n)${_keywords_match}=" "\\1_\\2=" _src_data "${_src_data}" ) + string( REGEX REPLACE "(^|\n)${_keywords_match}[ ]*=[ ]*" "\\1_\\2=" _src_data "${_src_data}" ) file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_out_name}.in "${_src_data}" ) # merge translations command @@ -1749,19 +1749,18 @@ macro( tde_create_translated_desktop ) # merge translations target add_custom_target( "${_target}" ALL DEPENDS ${_out_name} ) - install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${_out_name} DESTINATION ${_dest} ) else( ) - # just install the original file without translations - install( - FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_src} - RENAME ${_out_name} - DESTINATION ${_dest} - ) + # just write the original file without translations + file( READ ${_src} _src_data ) + file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_out_name} "${_src_data}" ) endif( ) + # install traslated desktop file + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${_out_name} DESTINATION ${_dest} ) + endmacro( ) |