diff options
-rw-r--r-- | modules/ECMPoQmTools.cmake | 10 | ||||
-rw-r--r-- | tests/ECMPoQmToolsTest/CMakeLists.txt | 4 | ||||
-rw-r--r-- | tests/ECMPoQmToolsTest/po/no-po/placeholder | 0 | ||||
-rw-r--r-- | tests/ECMPoQmToolsTest/po/should-not-be-installed | 0 |
4 files changed, 8 insertions, 6 deletions
diff --git a/modules/ECMPoQmTools.cmake b/modules/ECMPoQmTools.cmake index e217dd3e..3ce69581 100644 --- a/modules/ECMPoQmTools.cmake +++ b/modules/ECMPoQmTools.cmake @@ -188,13 +188,13 @@ function(ecm_install_po_files_as_qm podir) set(install_destination share/locale) endif() - file(GLOB lang_dirs "${podir}/*") - foreach(lang_dir ${lang_dirs}) - file(GLOB po_files "${lang_dir}/*.po") - get_filename_component(lang ${lang_dir} NAME) + file(GLOB po_files "${podir}/*/*.po") + foreach(po_file ${po_files}) + get_filename_component(po_dir ${po_file} DIRECTORY) + get_filename_component(lang ${po_dir} NAME) ecm_process_po_files_as_qm( ${lang} ALL - PO_FILES ${po_files} + PO_FILES ${po_file} INSTALL_DESTINATION ${install_destination} ) endforeach() diff --git a/tests/ECMPoQmToolsTest/CMakeLists.txt b/tests/ECMPoQmToolsTest/CMakeLists.txt index 3dcb3513..15351d2f 100644 --- a/tests/ECMPoQmToolsTest/CMakeLists.txt +++ b/tests/ECMPoQmToolsTest/CMakeLists.txt @@ -24,7 +24,9 @@ ecm_process_po_files_as_qm(fr ALL PO_FILES only-process.po ) -# Should create a bunch of .qm files and install them in share/locale +# Should create a bunch of .qm files and install them in share/locale. +# Should ignore files directly under po/ as well as directories under po/ which +# do not contain any .po files. ecm_install_po_files_as_qm(po) # Should create a bunch of .qm files and install them in diff --git a/tests/ECMPoQmToolsTest/po/no-po/placeholder b/tests/ECMPoQmToolsTest/po/no-po/placeholder new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/ECMPoQmToolsTest/po/no-po/placeholder diff --git a/tests/ECMPoQmToolsTest/po/should-not-be-installed b/tests/ECMPoQmToolsTest/po/should-not-be-installed new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/ECMPoQmToolsTest/po/should-not-be-installed |