summaryrefslogtreecommitdiffstats
path: root/modules/TDEMacros.cmake
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2020-06-10 20:59:30 +0200
committerSlávek Banko <slavek.banko@axis.cz>2020-06-12 13:28:16 +0200
commitaa52709a28f5528efee3e516561ca8d358a69abe (patch)
tree4bc16ff7e00c2e8a61061dd21cfcb6f6ac854d9f /modules/TDEMacros.cmake
parentb3a51ff373326c6fdcbc5c235690b7b4babc374f (diff)
downloadtde-cmake-aa52709a28f5528efee3e516561ca8d358a69abe.tar.gz
tde-cmake-aa52709a28f5528efee3e516561ca8d358a69abe.zip
tde_create_translated_desktop: For working files in a binary directory,
use the relative path according to the source directory instead of the base file names. This will prevent potential base file name collisions and allow the creation of common rules. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit c3b52f0e804a75c535f56c550354c0f894d7e960)
Diffstat (limited to 'modules/TDEMacros.cmake')
-rw-r--r--modules/TDEMacros.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index 1db31d9..f6dd338 100644
--- a/modules/TDEMacros.cmake
+++ b/modules/TDEMacros.cmake
@@ -1647,13 +1647,20 @@ macro( tde_create_translated_desktop )
if( NOT _src )
tde_message_fatal( "no source desktop file specified" )
endif( )
- get_filename_component( _basename ${_src} NAME )
+ get_filename_component( _basename ${_src} ABSOLUTE )
+ get_filename_component( _basedir ${_basename} PATH )
+ file( RELATIVE_PATH _basename "${CMAKE_CURRENT_SOURCE_DIR}" "${_basename}" )
# if no output name specified, use the same as source
if( NOT _out_name )
get_filename_component( _out_name ${_src} NAME )
endif( )
+ # prepare the binary directory according to source directory
+ file( RELATIVE_PATH _binary_basedir "${CMAKE_CURRENT_SOURCE_DIR}" "${_basedir}" )
+ set( _binary_basedir "${CMAKE_CURRENT_BINARY_DIR}/${_binary_basedir}" )
+ file( MAKE_DIRECTORY "${_binary_basedir}" )
+
# if no po directory specified, try to determine it
if( NOT _po_dir )
if( EXISTS ${CMAKE_SOURCE_DIR}/translations/desktop_files/${_basename} AND