diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-04-02 05:26:51 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-04-04 15:20:41 +0200 |
commit | 89b5f26297f6250abd4c65f364313545bc4507d9 (patch) | |
tree | a9431b0da781d2f1e97f03cda5dc0323a14815ae | |
parent | f0659a0437dbe9f6943c7429dd6651d165dfa1c3 (diff) | |
download | tde-cmake-89b5f26297f6250abd4c65f364313545bc4507d9.tar.gz tde-cmake-89b5f26297f6250abd4c65f364313545bc4507d9.zip |
tde_create_translated_desktop: Cleaning the LINGUAS file
that is generated for merging desktop file translations
will not be performed as a POST BUILD command, but as a
separate target.
This solves premature file deletion if multiple desktop
files use a common translation folder.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 7183c21e0836e839d3931d18b1971c7aafccb30e)
-rw-r--r-- | modules/TDEMacros.cmake | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 8478f2a..60b6842 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -1684,12 +1684,21 @@ macro( tde_create_translated_desktop ) DEPENDS ${_src} ) add_custom_target( "${_out_name}-translated" ALL DEPENDS ${_out_name} ) - add_custom_command( - TARGET "${_out_name}-translated" - POST_BUILD COMMAND ${CMAKE_COMMAND} -E remove ${_po_dir}/LINGUAS - ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${_out_name} DESTINATION ${_dest} ) + # cleanup LINGUAS file + get_filename_component( _linguas_path "${_po_dir}/LINGUAS" ABSOLUTE ) + file( RELATIVE_PATH _linguas_path "${CMAKE_SOURCE_DIR}" "${_linguas_path}" ) + string( REPLACE "/" "+" _linguas_cleanup_target "${_linguas_path}" ) + if( NOT TARGET ${_linguas_cleanup_target} ) + add_custom_target( ${_linguas_cleanup_target} ALL + COMMAND ${CMAKE_COMMAND} -E remove ${_po_dir}/LINGUAS + COMMENT "Cleanup ${_linguas_path} file..." + ) + endif( NOT TARGET ${_linguas_cleanup_target} ) + + add_dependencies( ${_linguas_cleanup_target} "${_out_name}-translated" ) + else( ) # create template for intltool-merge |