@ -1520,6 +1520,12 @@ macro( tde_create_translated_desktop )
file ( GLOB _translations RELATIVE "${_po_dir}" "${_po_dir}/*.po" )
file ( GLOB _translations RELATIVE "${_po_dir}" "${_po_dir}/*.po" )
endif ( )
endif ( )
if ( _translations )
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 ${ _src } ABSOLUTE )
file ( RELATIVE_PATH _target "${CMAKE_SOURCE_DIR}" "${_target}" )
string ( REPLACE "/" "+" _target "${_target}-translated" )
if ( DESKTOP_MERGE_MSGFMT )
if ( DESKTOP_MERGE_MSGFMT )
# c r e a t e L I N G U A S f i l e f o r m s g f m t
# c r e a t e L I N G U A S f i l e f o r m s g f m t
@ -1532,28 +1538,25 @@ macro( tde_create_translated_desktop )
list ( APPEND _keywords_arg "--keyword=\" ${ _keyword } \"" )
list ( APPEND _keywords_arg "--keyword=\" ${ _keyword } \"" )
endforeach ( )
endforeach ( )
# m e r g e t r a n s l a t i o n s
# 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 )
get_filename_component ( _src ${ _src } ABSOLUTE )
add_custom_command (
add_custom_command (
O U T P U T $ { _ o u t _ n a m e }
O U T P U T $ { _ o u t _ n a m e }
C O M M A N D $ { 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 $ { _ o u t _ n a m e } $ { _ k e y w o r d s _ a r g }
C O M M A N D $ { 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 $ { _ o u t _ n a m e } $ { _ k e y w o r d s _ a r g }
D E P E N D S $ { _ s r c }
D E P E N D S $ { _ s r c }
)
)
add_custom_target ( "${_out_name}-translated" ALL DEPENDS ${ _out_name } )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } / ${ _out_name } DESTINATION ${ _dest } )
# c l e a n u p L I N G U A S f i l e
# c l e a n u p L I N G U A S f i l e
get_filename_component ( _linguas_path "${_po_dir}/LINGUAS" ABSOLUTE )
get_filename_component ( _linguas_path "${_po_dir}/LINGUAS" ABSOLUTE )
file ( RELATIVE_PATH _linguas_path "${CMAKE_SOURCE_DIR}" "${_linguas_path}" )
file ( RELATIVE_PATH _linguas_path "${CMAKE_SOURCE_DIR}" "${_linguas_path}" )
string ( REPLACE "/" "+" _linguas_cleanup_target "${_linguas_path} " )
string ( REPLACE "/" "+" _linguas_cleanup_target "${_linguas_path} -cleanup " )
if ( NOT TARGET ${ _linguas_cleanup_target } )
if ( NOT TARGET ${ _linguas_cleanup_target } )
add_custom_target ( ${ _linguas_cleanup_target } ALL
add_custom_target ( ${ _linguas_cleanup_target } ALL
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e $ { _ p o _ d i r } / L I N G U A S
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e $ { _ p o _ d i r } / L I N G U A S
C O M M E N T " C l e a n u p $ { _ l i n g u a s _ p a t h } f i l e . . . "
C O M M E N T " C l e a n u p $ { _ l i n g u a s _ p a t h } f i l e . . . "
)
)
endif ( NOT TARGET ${ _linguas_cleanup_target } )
endif ( )
add_dependencies ( ${ _linguas_cleanup_target } "${_target}" )
add_dependencies ( ${ _linguas_cleanup_target } "${_out_name}-translated" )
else ( )
else ( )
@ -1563,16 +1566,19 @@ macro( tde_create_translated_desktop )
string ( REGEX REPLACE "(^|\n)${_keywords_match}=" "\\1_\\2=" _src_data "${_src_data}" )
string ( REGEX REPLACE "(^|\n)${_keywords_match}=" "\\1_\\2=" _src_data "${_src_data}" )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } / ${ _out_name } .in "${_src_data}" )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } / ${ _out_name } .in "${_src_data}" )
# m e r g e t r a n s l a t i o n s
# m e r g e t r a n s l a t i o n s c o m m a n d
add_custom_command (
add_custom_command (
O U T P U T $ { _ o u t _ n a m e }
O U T P U T $ { _ o u t _ n a m e }
C O M M A N D $ { I N T L T O O L _ M E R G E _ E X E C U T A B L E } - d $ { _ p o _ d i r } $ { _ o u t _ n a m e } . i n $ { _ o u t _ n a m e }
C O M M A N D $ { I N T L T O O L _ M E R G E _ E X E C U T A B L E } - d $ { _ p o _ d i r } $ { _ o u t _ n a m e } . i n $ { _ o u t _ n a m e }
D E P E N D S $ { _ s r c }
D E P E N D S $ { _ s r c }
)
)
add_custom_target ( "${_out_name}-translated" ALL DEPENDS ${ _out_name } )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } / ${ _out_name } DESTINATION ${ _dest } )
endif ( )
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 ${ _out_name } )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } / ${ _out_name } DESTINATION ${ _dest } )
else ( )
else ( )
# j u s t i n s t a l l 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
# j u s t i n s t a l l 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