From 3b6509cacff64191851aa1db18f9b2a421c5d33d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 27 May 2020 03:27:04 +0200 Subject: [PATCH] tde_create_translated_desktop: Use output name only during installation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the cmake binary directory, the name of the working file must be used according to the source file to avoid possible collisions if the source directory contains multiple desktop files installed as a ".directory" file in multiple destination directories. Signed-off-by: Slávek Banko --- modules/TDEMacros.cmake | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index febfc0c..c1f8ab6 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -1889,8 +1889,8 @@ macro( tde_create_translated_desktop ) # merge translations command get_filename_component( _src ${_src} ABSOLUTE ) add_custom_command( - OUTPUT ${_out_name} - COMMAND ${MSGFMT_EXECUTABLE} --desktop --template ${_src} -d ${_po_dir} -o ${_out_name} ${_keywords_arg} + OUTPUT ${_basename} + COMMAND ${MSGFMT_EXECUTABLE} --desktop --template ${_src} -d ${_po_dir} -o ${_basename} ${_keywords_arg} DEPENDS ${_src} ) @@ -1912,30 +1912,34 @@ macro( tde_create_translated_desktop ) file( READ ${_src} _src_data ) string( REPLACE ";" "|" _keywords_match "(${_keywords_desktop})" ) 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}/${_basename}.in "${_src_data}" ) # merge translations command add_custom_command( - OUTPUT ${_out_name} - COMMAND ${INTLTOOL_MERGE_EXECUTABLE} -d ${_po_dir} ${_out_name}.in ${_out_name} + OUTPUT ${_basename} + COMMAND ${INTLTOOL_MERGE_EXECUTABLE} -d ${_po_dir} ${_basename}.in ${_basename} DEPENDS ${_src} ) endif( ) # merge translations target - add_custom_target( "${_target}" ALL DEPENDS ${_out_name} ) + add_custom_target( "${_target}" ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_basename} ) else( ) # just write the original file without translations file( READ ${_src} _src_data ) - file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_out_name} "${_src_data}" ) + file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_basename} "${_src_data}" ) endif( ) # install traslated desktop file - install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${_out_name} DESTINATION ${_dest} ) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename} + RENAME ${_out_name} + DESTINATION ${_dest} + ) endmacro( )