diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2020-05-27 03:27:04 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-05-27 03:27:04 +0200 |
commit | 3b6509cacff64191851aa1db18f9b2a421c5d33d (patch) | |
tree | da3e5a63eb902076d69e0f332fe75341ca09d03b /modules/TDEMacros.cmake | |
parent | 374fcabb184ddc3d455d8037a9cbdc20fd60744f (diff) | |
download | tde-cmake-3b6509cacff64191851aa1db18f9b2a421c5d33d.tar.gz tde-cmake-3b6509cacff64191851aa1db18f9b2a421c5d33d.zip |
tde_create_translated_desktop: Use output name only during installation.
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 <slavek.banko@axis.cz>
Diffstat (limited to 'modules/TDEMacros.cmake')
-rw-r--r-- | modules/TDEMacros.cmake | 20 |
1 files 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( ) |