Update TDEL10n module

+ Use file( READ ) during updating references for resources
  because file( STRINGS ) has problems with special characters.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 0f348d894e)
r14.0.x
Slávek Banko 6 years ago
parent 5e93c9bb7c
commit 9cad1a7d43
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -432,11 +432,13 @@ macro( tde_l10n_create_template )
# update references for resources to original files and line numbers # update references for resources to original files and line numbers
if( _rcs OR _attributes ) if( _rcs OR _attributes )
file( STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/extracted-rc.tde_l10n" _extractedRC ) file( READ "${CMAKE_CURRENT_SOURCE_DIR}/extracted-rc.tde_l10n" _extractedRC )
list( LENGTH _extractedRC _extractedRC_len ) string( REGEX REPLACE "[^\n]" "" _extractedRC_len "${_extractedRC}" )
string( LENGTH "+${_extractedRC_len}" _extractedRC_len )
set( _rcPos 0 ) set( _rcPos 0 )
while( _rcPos LESS ${_extractedRC_len} ) while( _rcPos LESS ${_extractedRC_len} )
list( GET _extractedRC ${_rcPos} _rcLine ) string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _rcLine "${_extractedRC}" )
string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\2" _extractedRC "${_extractedRC}" )
math( EXPR _rcPos "${_rcPos}+1" ) math( EXPR _rcPos "${_rcPos}+1" )
if( "${_rcLine}" MATCHES "^//i18n: file .* line [0-9]*$" ) if( "${_rcLine}" MATCHES "^//i18n: file .* line [0-9]*$" )
string( REGEX REPLACE "^//i18n: file (.*) line ([0-9]*)$" "\\1:\\2" _rcOrig ${_rcLine} ) string( REGEX REPLACE "^//i18n: file (.*) line ([0-9]*)$" "\\1:\\2" _rcOrig ${_rcLine} )

Loading…
Cancel
Save