summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-12-12 16:34:58 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-01-09 01:54:38 +0100
commit3c409426806d9b7c15bd0142b5154b3f2f2026e3 (patch)
treec8fcf05893804e77be99b2c75e969febe9ef1e17
parent8f3b50336f8ec4b62d2a4c27eddaa743b243220f (diff)
downloadtde-cmake-3c409426.tar.gz
tde-cmake-3c409426.zip
Update TDEL10n module
+ Use tde_l10n_prepare_xml function instead of extractrc script. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--modules/TDEL10n.cmake32
1 files changed, 6 insertions, 26 deletions
diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake
index 9b769d9..efc0c14 100644
--- a/modules/TDEL10n.cmake
+++ b/modules/TDEL10n.cmake
@@ -34,16 +34,6 @@ if( NOT DEFINED KDE_XGETTEXT_EXECUTABLE )
endif( )
endif( )
-if( NOT DEFINED EXTRACTRC_EXECUTABLE )
- find_program( EXTRACTRC_EXECUTABLE
- NAMES extractrc
- HINTS "${TDE_PREFIX}/bin"
- )
- if( NOT EXTRACTRC_EXECUTABLE )
- tde_message_fatal( "extractrc is required but not found" )
- endif( )
-endif( )
-
if( NOT DEFINED EXTRACTATTR_EXECUTABLE )
find_program( EXTRACTATTR_EXECUTABLE
NAMES extractattr
@@ -181,7 +171,6 @@ macro( tde_l10n_create_template )
unset( _sources )
unset( _excludes )
unset( _files )
- unset( _rcs )
unset( _desktops )
unset( _pots )
unset( _dest )
@@ -345,30 +334,21 @@ macro( tde_l10n_create_template )
list( APPEND _add_keywords "-k${_keyword}" )
endforeach( )
- # pick resource files *.kcfg, *.rc and *.ui
+ # prepare resource files *.kcfg, *.rc and *.ui
foreach( _src ${_files} )
if( ${_src} MATCHES "\\.(kcfg|rc|ui)(\\.cmake)?(\\.tde_l10n)?$" )
- list( APPEND _rcs ${_src} )
+ tde_l10n_prepare_xml( ${_src} )
list( REMOVE_ITEM _files ${_src} )
+ list( APPEND _files "${_src}.tde_l10n" )
endif( )
endforeach( )
# prepare extracted-rc.tde_l10n
- if( _rcs OR _attributes )
+ if( _attributes )
file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/extracted-rc.tde_l10n "" )
list( APPEND _files extracted-rc.tde_l10n )
endif( )
- # process resource files
- if( _rcs )
- execute_process(
- COMMAND ${EXTRACTRC_EXECUTABLE} ${_rcs}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- OUTPUT_VARIABLE _sources_rc
- )
- file( APPEND ${CMAKE_CURRENT_SOURCE_DIR}/extracted-rc.tde_l10n "${_sources_rc}" )
- endif( )
-
# extract attributes
if( _attributes )
foreach( _attrib ${_attributes} )
@@ -493,7 +473,7 @@ macro( tde_l10n_create_template )
if( _pot )
# update references for resources to original files and line numbers
- if( _rcs OR _attributes )
+ if( _attributes )
file( READ "${CMAKE_CURRENT_SOURCE_DIR}/extracted-rc.tde_l10n" _extractedRC )
string( REGEX REPLACE "[^\n]" "" _extractedRC_len "${_extractedRC}" )
string( LENGTH "+${_extractedRC_len}" _extractedRC_len )
@@ -532,7 +512,7 @@ macro( tde_l10n_create_template )
endif( _pot )
# cleanup
- foreach( _file ${_files} ${_rcs} ${_desktops} )
+ foreach( _file ${_files} ${_desktops} )
if( "${_file}" MATCHES "\\.tde_l10n$" )
file( REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/${_file} )
endif( )