diff options
author | Kai Blaschke <kai.blaschke@gdata.de> | 2020-01-13 14:58:55 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2020-01-23 20:55:53 (GMT) |
commit | fd83dab339dc8f1231386a3cbf8de89355138f0c (patch) | |
tree | b711ad820a1fd78e73e0a09b97941e9415a0e6dc /Modules/Qt4Macros.cmake | |
parent | e4c07116027e7c82fab658b11a630492052f3761 (diff) | |
download | CMake-fd83dab339dc8f1231386a3cbf8de89355138f0c.zip CMake-fd83dab339dc8f1231386a3cbf8de89355138f0c.tar.gz CMake-fd83dab339dc8f1231386a3cbf8de89355138f0c.tar.bz2 |
Qt4Macros: Only cut last extension (".ts") and replace it with ".qm"
Diffstat (limited to 'Modules/Qt4Macros.cmake')
-rw-r--r-- | Modules/Qt4Macros.cmake | 12 |
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} |