diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2015-03-06 12:13:38 +0100 |
---|---|---|
committer | Harald Sitter <sitter@kde.org> | 2015-03-06 12:14:56 +0100 |
commit | bc27ee561756cb6e1e51e3589addab8656fd4b03 (patch) | |
tree | 6751e74c5fc9e6246f7a5e2030521528ddea71cb | |
parent | 0466f8f95e214d91b17ef078be221c6d0025e466 (diff) | |
download | extra-cmake-modules-1.8.0.tar.gz extra-cmake-modules-1.8.0.tar.bz2 |
Use lconvert path from Qt cmake config when on Qt >= 5.3.1v1.8.0-rc1v1.8.0
Qt5LinguistToolsConfig.cmake defines CMake target for lconvert since Qt 5.3.1,
so we should use that if it is available.
Our own hacks were not working in some configurations (i.e. when there is
/usr/bin/lconvert managed by qtchooser, but no qtchooser configuration file).
REVIEW: 122626
-rw-r--r-- | modules/ECMCreateQmFromPoFiles.cmake | 19 | ||||
-rw-r--r-- | modules/ECMPoQmTools.cmake | 22 |
2 files changed, 24 insertions, 17 deletions
diff --git a/modules/ECMCreateQmFromPoFiles.cmake b/modules/ECMCreateQmFromPoFiles.cmake index 3f134fbb..afd6f786 100644 --- a/modules/ECMCreateQmFromPoFiles.cmake +++ b/modules/ECMCreateQmFromPoFiles.cmake @@ -110,13 +110,18 @@ endfunction() function(_ECM_QM_CREATE_TARGET install_destination catalog_name) # Find lconvert - get_target_property(lrelease_location Qt5::lrelease LOCATION) - get_filename_component(lrelease_path ${lrelease_location} PATH) - find_program(lconvert_executable - NAMES lconvert-qt5 lconvert - PATHS ${lrelease_path} - NO_DEFAULT_PATH - ) + if(TARGET Qt5::lconvert) + set(lconvert_executable Qt5::lconvert) + else() + # Qt < 5.3.1 does not define Qt5::lconvert + get_target_property(lrelease_location Qt5::lrelease LOCATION) + get_filename_component(lrelease_path ${lrelease_location} PATH) + find_program(lconvert_executable + NAMES lconvert-qt5 lconvert + PATHS ${lrelease_path} + NO_DEFAULT_PATH + ) + endif() if (catalog_name) set(install_args RENAME ${catalog_name}.qm) diff --git a/modules/ECMPoQmTools.cmake b/modules/ECMPoQmTools.cmake index 015b7f90..b25c1bbf 100644 --- a/modules/ECMPoQmTools.cmake +++ b/modules/ECMPoQmTools.cmake @@ -121,18 +121,20 @@ function(ecm_process_po_files_as_qm lang) endif() # Find lrelease and lconvert - - # This gives us Qt5::lrelease but unfortunately no Qt5::lconvert See - # https://bugreports.qt-project.org/browse/QTBUG-37937 find_package(Qt5LinguistTools CONFIG REQUIRED) - get_target_property(lrelease_location Qt5::lrelease LOCATION) - get_filename_component(lrelease_path ${lrelease_location} PATH) - find_program(lconvert_executable - NAMES lconvert-qt5 lconvert - PATHS ${lrelease_path} - NO_DEFAULT_PATH - ) + if(TARGET Qt5::lconvert) + set(lconvert_executable Qt5::lconvert) + else() + # Qt < 5.3.1 does not define Qt5::lconvert + get_target_property(lrelease_location Qt5::lrelease LOCATION) + get_filename_component(lrelease_path ${lrelease_location} PATH) + find_program(lconvert_executable + NAMES lconvert-qt5 lconvert + PATHS ${lrelease_path} + NO_DEFAULT_PATH + ) + endif() # Create commands to turn po files into qm files set(qm_files) |