summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2020-01-25 21:48:06 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-01-25 21:48:15 (GMT)
commitb578b002239d1ab2c7ab79a704bc98b7c5b48e7b (patch)
treeae62635815869405bfc4945fe4a7477240c419cf
parent33e7bd66c09ee51edbbccfc1014813e30d80ec5f (diff)
parentfd83dab339dc8f1231386a3cbf8de89355138f0c (diff)
downloadCMake-b578b002239d1ab2c7ab79a704bc98b7c5b48e7b.zip
CMake-b578b002239d1ab2c7ab79a704bc98b7c5b48e7b.tar.gz
CMake-b578b002239d1ab2c7ab79a704bc98b7c5b48e7b.tar.bz2
Merge topic 'Qt4Macros-last-ext'
fd83dab339 Qt4Macros: Only cut last extension (".ts") and replace it with ".qm" Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4211
-rw-r--r--Modules/Qt4Macros.cmake12
1 files changed, 7 insertions, 5 deletions
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index 33cacf1..cb6ae43 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -436,7 +436,7 @@ macro(QT4_CREATE_TRANSLATION _qm_files)
if(_my_sources)
# make a .pro file to call lupdate on, so we don't make our commands too
# long for some systems
- get_filename_component(_ts_name ${_ts_file} NAME_WE)
+ get_filename_component(_ts_name ${_ts_file} NAME)
set(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro)
set(_pro_srcs)
foreach(_pro_src ${_my_sources})
@@ -463,13 +463,15 @@ endmacro()
macro(QT4_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_property(output_location SOURCE ${_abs_FILE} PROPERTY OUTPUT_LOCATION)
+ 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}