summaryrefslogtreecommitdiffstats
path: root/modules/TDEL10n.cmake
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2020-03-21 14:16:22 +0100
committerSlávek Banko <[email protected]>2020-03-23 17:27:18 +0100
commit1f4d4093ad9fd0c765a0bdb38d393b7b1ae9222c (patch)
treea0974918a4342e4db4fd2f1e15d2b77471d1be7b /modules/TDEL10n.cmake
parentf07fe12daf3611403ccf868069f970d6a16e4521 (diff)
downloadtde-cmake-1f4d4093ad9fd0c765a0bdb38d393b7b1ae9222c.tar.gz
tde-cmake-1f4d4093ad9fd0c765a0bdb38d393b7b1ae9222c.zip
Update TDEL10n module
+ Simplify entering a catalog name for placement in a directory of the same name. Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'modules/TDEL10n.cmake')
-rw-r--r--modules/TDEL10n.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/TDEL10n.cmake b/modules/TDEL10n.cmake
index 27cf9ae..9a6053f 100644
--- a/modules/TDEL10n.cmake
+++ b/modules/TDEL10n.cmake
@@ -155,6 +155,8 @@ endfunction( )
#####
##### Where:
##### CATALOG determines the target file name (without pot suffix).
+##### If the name ends with '/', a catalog of the same name
+##### will be created in the specified directory.
##### SOURCES can be specified by several options:
##### a) Do not specify anything
##### - all usual source files will be automatically searched.
@@ -307,6 +309,11 @@ macro( tde_l10n_create_template )
set( _dest "${CMAKE_CURRENT_SOURCE_DIR}/${_dest}" )
endif( )
+ if( ${_catalog} MATCHES "/$" )
+ string( REGEX REPLACE "/$" "" _catalog "${_catalog}" )
+ get_filename_component( _catalog_base "${_catalog}" NAME )
+ set( _catalog "${_catalog}/${_catalog_base}" )
+ endif( )
get_filename_component( _potFilename "${_dest}${_catalog}.pot" ABSOLUTE )
file( RELATIVE_PATH _potFilename ${CMAKE_SOURCE_DIR} ${_potFilename} )
message( STATUS "Create translation template ${_potFilename}" )