diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2018-12-09 00:59:46 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-12-09 16:22:36 +0100 |
commit | 9cad1a7d433e9624ae0691d236d08093b92d4d25 (patch) | |
tree | c8e56bbce3eeb0eb6637df321b4d8a5f94ab24c6 | |
parent | 5e93c9bb7c78115298991122e694c47e027208c9 (diff) | |
download | tde-cmake-9cad1a7d433e9624ae0691d236d08093b92d4d25.tar.gz tde-cmake-9cad1a7d433e9624ae0691d236d08093b92d4d25.zip |
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 0f348d894e09f08c9caf1c363fb48b61efec7e0f)
-rw-r--r-- | modules/TDEL10n.cmake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake index 58a4313..9702553 100644 --- a/modules/TDEL10n.cmake +++ b/modules/TDEL10n.cmake @@ -432,11 +432,13 @@ macro( tde_l10n_create_template ) # update references for resources to original files and line numbers if( _rcs OR _attributes ) - file( STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/extracted-rc.tde_l10n" _extractedRC ) - list( LENGTH _extractedRC _extractedRC_len ) + file( READ "${CMAKE_CURRENT_SOURCE_DIR}/extracted-rc.tde_l10n" _extractedRC ) + string( REGEX REPLACE "[^\n]" "" _extractedRC_len "${_extractedRC}" ) + string( LENGTH "+${_extractedRC_len}" _extractedRC_len ) set( _rcPos 0 ) 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" ) if( "${_rcLine}" MATCHES "^//i18n: file .* line [0-9]*$" ) string( REGEX REPLACE "^//i18n: file (.*) line ([0-9]*)$" "\\1:\\2" _rcOrig ${_rcLine} ) |