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
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 @@
     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 @@
 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}