Update TDEL10n module

+ Use tde_l10n_prepare_xml function instead of extractrc script.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/10/head
Slávek Banko 6 years ago
parent 8f3b50336f
commit 3c40942680
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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( )

Loading…
Cancel
Save