diff options
author | Slávek Banko <[email protected]> | 2020-06-23 19:37:31 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2020-06-25 00:43:23 +0200 |
commit | 05e7242b4e8961df3f6e96cd50fc1343307790e2 (patch) | |
tree | 5053de49810c192128a62d970b8ebb8dbf737355 | |
parent | b69bc31c49ae9f6decbfdeba9e3841e7ca3d9b3f (diff) | |
download | tde-cmake-05e7242b4e8961df3f6e96cd50fc1343307790e2.tar.gz tde-cmake-05e7242b4e8961df3f6e96cd50fc1343307790e2.zip |
tde_create_translated_desktop: PO_DIR can be specified as relative.
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit 1baa4cbbd1bcfd4765c5aeeed07506f312e03bb6)
-rw-r--r-- | modules/TDEMacros.cmake | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake index 988c63f..6a61809 100644 --- a/modules/TDEMacros.cmake +++ b/modules/TDEMacros.cmake @@ -1893,16 +1893,25 @@ macro( tde_create_translated_desktop ) get_filename_component( _out_name ${_basename} NAME ) endif( ) - # if no po directory specified, try to determine it - if( NOT _po_dir ) - if( EXISTS ${CMAKE_SOURCE_DIR}/translations/desktop_files/${_basename} AND - IS_DIRECTORY ${CMAKE_SOURCE_DIR}/translations/desktop_files/${_basename} ) - set( _po_dir ${CMAKE_SOURCE_DIR}/translations/desktop_files/${_basename} ) + # determine po directory + if( _po_dir ) + set( _po_base ${_po_dir} ) + else() + get_filename_component( _po_base ${_basename} NAME ) + endif() + if( IS_ABSOLUTE ${_po_base} ) + set( _po_dir ${_po_base} ) + else() + if( EXISTS ${CMAKE_SOURCE_DIR}/translations/desktop_files/${_po_base} AND + IS_DIRECTORY ${CMAKE_SOURCE_DIR}/translations/desktop_files/${_po_base} ) + set( _po_dir ${CMAKE_SOURCE_DIR}/translations/desktop_files/${_po_base} ) - elseif( EXISTS ${CMAKE_SOURCE_DIR}/po/desktop_files/${_basename} AND - IS_DIRECTORY ${CMAKE_SOURCE_DIR}/po/desktop_files/${_basename} ) - set( _po_dir ${CMAKE_SOURCE_DIR}/po/desktop_files/${_basename} ) + elseif( EXISTS ${CMAKE_SOURCE_DIR}/po/desktop_files/${_po_base} AND + IS_DIRECTORY ${CMAKE_SOURCE_DIR}/po/desktop_files/${_po_base} ) + set( _po_dir ${CMAKE_SOURCE_DIR}/po/desktop_files/${_po_base} ) + else() + set( _po_dir ${CMAKE_SOURCE_DIR}/translations/desktop_files ) endif( ) endif( ) |