diff options
author | Aleix Pol <aleixpol@kde.org> | 2018-08-03 00:44:59 +0200 |
---|---|---|
committer | Aleix Pol <aleixpol@kde.org> | 2018-08-06 16:22:28 +0200 |
commit | 02881711cfce2281d35984469fb361120824bfb3 (patch) | |
tree | dba6edc82e847612af51bf86036e95cd55f1f6fc /modules/ECMPoQmTools.cmake | |
parent | e5077dd490dbca798e06607fa0ddaec633a7e6c3 (diff) | |
download | extra-cmake-modules-02881711cfce2281d35984469fb361120824bfb3.tar.gz extra-cmake-modules-02881711cfce2281d35984469fb361120824bfb3.tar.bz2 |
Make it possible for ECM to detect po files at configure time
Summary:
ECMPoQmTools will need to have the translations downloaded at configure time instead of on build time, otherwise it needs an awkward second configure.
To that end we introduce a KDE_L10N_SYNC_TRANSLATIONS variable that allows it to do so.
ECMPoTools will download the translations in the build directory, because cmake shouldn't touch the sources. Have it check the build directory too when the macro is called.
Test Plan: Built analitza translations.
Reviewers: #frameworks, cgiboudeaux
Reviewed By: cgiboudeaux
Subscribers: cgiboudeaux, kde-frameworks-devel, kde-buildsystem
Tags: #frameworks, #build_system
Differential Revision: https://phabricator.kde.org/D14569
Diffstat (limited to 'modules/ECMPoQmTools.cmake')
-rw-r--r-- | modules/ECMPoQmTools.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/ECMPoQmTools.cmake b/modules/ECMPoQmTools.cmake index 49557b8e..9a281221 100644 --- a/modules/ECMPoQmTools.cmake +++ b/modules/ECMPoQmTools.cmake @@ -213,6 +213,20 @@ function(ecm_install_po_files_as_qm podir) set(install_destination share/locale) endif() + get_filename_component(absolute_podir ${podir} ABSOLUTE) + + # we try to find the po directory in the binary directory, in case it was downloaded + # using ECM + if (NOT (EXISTS "${absolute_podir}" AND IS_DIRECTORY "${absolute_podir}")) + get_filename_component(absolute_podir ${CMAKE_BINARY_DIR}/${podir} ABSOLUTE) + endif() + + if (NOT (EXISTS "${absolute_podir}" AND IS_DIRECTORY "${absolute_podir}")) + # Nothing to do if there's no podir and it would create an empty + # LOCALE_INSTALL_DIR in that case. + return() + endif() + file(GLOB po_files "${podir}/*/*.po") foreach(po_file ${po_files}) get_filename_component(po_dir ${po_file} DIRECTORY) |