summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Leutelt <martin.leutelt@basyskom.com>2017-11-09 09:22:08 +0100
committerMartin Leutelt <martin.leutelt@basyskom.com>2017-12-05 08:04:32 +0000
commitba7fe8fe13fc4984b4cd162df1f3dafa92233664 (patch)
treed1509f80f2cb61b952e6c5bc5f483e495baba728
parentead4427365690b72de63eaf2cd9a1f51fadcc0da (diff)
downloadqttools-ba7fe8fe13fc4984b4cd162df1f3dafa92233664.tar.gz
Fix qt5_add_translation macro to return correct file names
The CMake macro now determines the file names of the given ts files correctly when a file name contains multiple dots. Instead of using the first dot to identify the file extension now the last one is used. Task-number: QTBUG-64317 Change-Id: I9a8423307679fb722fb4b0bc2f0af19f0f7ee821 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
-rw-r--r--src/linguist/Qt5LinguistToolsMacros.cmake8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/linguist/Qt5LinguistToolsMacros.cmake b/src/linguist/Qt5LinguistToolsMacros.cmake
index 6013cc6ee..8e363a40f 100644
--- a/src/linguist/Qt5LinguistToolsMacros.cmake
+++ b/src/linguist/Qt5LinguistToolsMacros.cmake
@@ -84,13 +84,15 @@ endfunction()
function(QT5_ADD_TRANSLATION _qm_files)
foreach(_current_FILE ${ARGN})
get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE)
- get_filename_component(qm ${_abs_FILE} NAME_WE)
+ get_filename_component(qm ${_abs_FILE} NAME)
+ # everything before the last dot has to be considered the file name (including other dots)
+ string(REGEX REPLACE "\\.[^.]*$" "" FILE_NAME ${qm})
get_source_file_property(output_location ${_abs_FILE} OUTPUT_LOCATION)
if(output_location)
file(MAKE_DIRECTORY "${output_location}")
- set(qm "${output_location}/${qm}.qm")
+ set(qm "${output_location}/${FILE_NAME}.qm")
else()
- set(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
+ set(qm "${CMAKE_CURRENT_BINARY_DIR}/${FILE_NAME}.qm")
endif()
add_custom_command(OUTPUT ${qm}