summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-01-01 18:53:23 +0100
committerSlávek Banko <slavek.banko@axis.cz>2020-01-01 18:56:36 +0100
commitaa8945861fdbe264a3faccf48200eeb1636c10a8 (patch)
tree0da461c85cdd275385efb2e8703ba76b1281993c
parent2c8462b60eacdaf31bb236d6e1ea9ecb28a4ec50 (diff)
downloadtdebase-aa8945861fdbe264a3faccf48200eeb1636c10a8.zip
tdebase-aa8945861fdbe264a3faccf48200eeb1636c10a8.tar.gz
CMakeL10n: Extract konsole schemas and keytabs directly from definition
files instead of generating temporary name list file. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit b496ee27b9119a3cbf90b7b493fff499b8d66e7b)
-rw-r--r--konsole/konsole/CMakeL10n.txt27
1 files changed, 15 insertions, 12 deletions
diff --git a/konsole/konsole/CMakeL10n.txt b/konsole/konsole/CMakeL10n.txt
index e9ca207..d67c32d 100644
--- a/konsole/konsole/CMakeL10n.txt
+++ b/konsole/konsole/CMakeL10n.txt
@@ -1,30 +1,33 @@
##### prepare list of schemas ###################
-file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/schemas.tde_l10n "" )
file( GLOB _konsole_schema_files
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../other/*.[Ss]chema
)
+unset( _konsole_schemas )
list( SORT _konsole_schema_files )
foreach( _konsole_schema_file ${_konsole_schema_files} )
- file( STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/${_konsole_schema_file} _konsole_schema_title REGEX "^title " )
- if( _konsole_schema_title )
- string( REGEX REPLACE "^title +(.*) *" "\\1" _konsole_schema_title ${_konsole_schema_title} )
- file( APPEND ${CMAKE_CURRENT_SOURCE_DIR}/schemas.tde_l10n "i18n(\"${_konsole_schema_title}\");\n" )
- endif( )
+ file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_konsole_schema_file} _konsole_schema_data )
+ string( REGEX REPLACE "(^|\n)([^\n]+)" "\\1:\\2" _konsole_schema_data "${_konsole_schema_data}" )
+ string( REGEX REPLACE "(^|\n):title +([^\n]*)" "\\1i18n(\"\\2\");" _konsole_schema_data "${_konsole_schema_data}" )
+ string( REGEX REPLACE "(^|\n):[^\n]*" "\\1" _konsole_schema_data "${_konsole_schema_data}" )
+ file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${_konsole_schema_file}.tde_l10n "${_konsole_schema_data}" )
+ list( APPEND _konsole_schemas ${_konsole_schema_file}.tde_l10n )
endforeach( )
file( GLOB _konsole_keytab_files
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../other/*.[Kk]eytab
)
+unset( _konsole_keytabs )
list( SORT _konsole_keytab_files )
foreach( _konsole_keytab_file ${_konsole_keytab_files} )
- file( STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/${_konsole_keytab_file} _konsole_keytab_title REGEX "^keyboard " )
- if( _konsole_keytab_title )
- string( REGEX REPLACE "^keyboard +\"(.*)\" *" "\\1" _konsole_keytab_title ${_konsole_keytab_title} )
- file( APPEND ${CMAKE_CURRENT_SOURCE_DIR}/schemas.tde_l10n "i18n(\"${_konsole_keytab_title}\");\n" )
- endif( )
+ file( READ ${CMAKE_CURRENT_SOURCE_DIR}/${_konsole_keytab_file} _konsole_keytab_data )
+ string( REGEX REPLACE "(^|\n)([^\n]+)" "\\1:\\2" _konsole_keytab_data "${_konsole_keytab_data}" )
+ string( REGEX REPLACE "(^|\n):keyboard +([^\n]*)" "\\1i18n(\\2);" _konsole_keytab_data "${_konsole_keytab_data}" )
+ string( REGEX REPLACE "(^|\n):[^\n]*" "\\1" _konsole_keytab_data "${_konsole_keytab_data}" )
+ file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${_konsole_keytab_file}.tde_l10n "${_konsole_keytab_data}" )
+ list( APPEND _konsole_keytabs ${_konsole_keytab_file}.tde_l10n )
endforeach( )
@@ -32,5 +35,5 @@ endforeach( )
tde_l10n_create_template(
CATALOG "konsole"
- SOURCES "." "schemas.tde_l10n" "../tips"
+ SOURCES "." ${_konsole_schemas} ${_konsole_keytabs} "../tips"
)