@ -1986,14 +1986,18 @@ macro( tde_create_translated_desktop )
if ( EXISTS "${_po_dir}" AND IS_DIRECTORY "${_po_dir}" )
file ( GLOB _translations RELATIVE "${_po_dir}" "${_po_dir}/*.po" )
endif ( )
if ( _translations )
# p r e p a r e a f u l l n a m e f o r t h e t a r g e t
get_filename_component ( _target ${ _basename } ABSOLUTE )
file ( RELATIVE_PATH _target "${CMAKE_SOURCE_DIR}" "${_target}" )
string ( REPLACE "/" "+" _target "${_target}-translated" )
# p r e p a r e a f u l l n a m e f o r t h e t a r g e t
get_filename_component ( _target ${ _basename } ABSOLUTE )
file ( RELATIVE_PATH _target "${CMAKE_SOURCE_DIR}" "${_target}" )
string ( REPLACE "/" "+" _target "${_target}-translated" )
if ( NOT TARGET ${ _target } )
if ( NOT TARGET ${ _target } )
# u s e a b s o l u t e p a t h f o r s r c
get_filename_component ( _src ${ _src } ABSOLUTE )
if ( _translations )
if ( DESKTOP_MERGE_MSGFMT )
@ -2012,7 +2016,6 @@ macro( tde_create_translated_desktop )
endforeach ( )
# m e r g e t r a n s l a t i o n s c o m m a n d
get_filename_component ( _src ${ _src } ABSOLUTE )
add_custom_command (
O U T P U T $ { _ b a s e n a m e } $ { _ b i n s u f f i x }
C O M M A N D $ { C M A K E _ C O M M A N D } - E e n v " L I N G U A S = $ { _ l i n g u a s } " $ { M S G F M T _ E X E C U T A B L E } - - d e s k t o p - - t e m p l a t e $ { _ s r c } - d $ { _ p o _ d i r } - o $ { _ b a s e n a m e } $ { _ b i n s u f f i x } $ { _ k e y w o r d s _ a r g }
@ -2026,7 +2029,6 @@ macro( tde_create_translated_desktop )
string ( REPLACE ";" "|" _keywords_match "(${_keywords_desktop})" )
# m e r g e t r a n s l a t i o n s c o m m a n d
get_filename_component ( _src ${ _src } ABSOLUTE )
add_custom_command (
O U T P U T $ { _ b a s e n a m e } $ { _ b i n s u f f i x }
C O M M A N D $ { P E R L _ E X E C U T A B L E } - p - e " ' s / ^ $ { _ k e y w o r d s _ m a t c h } [ ] * = [ ] * / _ \ \ 1 = / ' " < $ { _ s r c } > $ { _ b a s e n a m e } . i n
@ -2038,15 +2040,20 @@ macro( tde_create_translated_desktop )
endif ( )
# m e r g e t r a n s l a t i o n s t a r g e t
add_custom_target ( "${_target}" ALL DEPENDS ${ CMAKE_CURRENT_BINARY_DIR } / ${ _basename } ${ _binsuffix } )
e ndif( )
e lse( )
else ( )
# j u s t c o p y t h e o r i g i n a l f i l e w i t h o u t t r a n s l a t i o n s
add_custom_command (
O U T P U T $ { _ b a s e n a m e } $ { _ b i n s u f f i x }
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { _ s r c } $ { _ b a s e n a m e } $ { _ b i n s u f f i x }
D E P E N D S $ { _ s r c }
C O M M E N T " S k i p i n g t r a n s l a t i o n a n d c o p y i n g s o u r c e f i l e t o $ { _ s o u r c e n a m e } "
)
endif ( )
# j u s t w r i t e t h e o r i g i n a l f i l e w i t h o u t t r a n s l a t i o n s
file ( READ ${ _src } _src_data )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } / ${ _basename } ${ _binsuffix } "${_src_data}" )
add_custom_target ( "${_target}" ALL DEPENDS ${ CMAKE_CURRENT_BINARY_DIR } / ${ _basename } ${ _binsuffix } )
endif ( )