From 02881711cfce2281d35984469fb361120824bfb3 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Fri, 3 Aug 2018 00:44:59 +0200 Subject: 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 --- modules/ECMPoQmTools.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/ECMPoQmTools.cmake') 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) -- cgit v1.2.1