aboutsummaryrefslogtreecommitdiff
path: root/tests/ECMPoQmToolsTest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ECMPoQmToolsTest/CMakeLists.txt')
-rw-r--r--tests/ECMPoQmToolsTest/CMakeLists.txt57
1 files changed, 52 insertions, 5 deletions
diff --git a/tests/ECMPoQmToolsTest/CMakeLists.txt b/tests/ECMPoQmToolsTest/CMakeLists.txt
index 15351d2f..76d80141 100644
--- a/tests/ECMPoQmToolsTest/CMakeLists.txt
+++ b/tests/ECMPoQmToolsTest/CMakeLists.txt
@@ -9,9 +9,13 @@ file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}")
include(ECMPoQmTools)
-# Should create ${CMAKE_CURRENT_BINARY_DIR}/qmloader.cpp and set QMLOADER_PATH
-# to its path
-ecm_create_qm_loader(QMLOADER_PATH catalog)
+include(../test_helpers.cmake)
+
+
+#
+# ecm_process_po_files_as_qm
+#
+
# Should create a process-and-install.qm file and install it
ecm_process_po_files_as_qm(fr ALL
@@ -24,20 +28,63 @@ ecm_process_po_files_as_qm(fr ALL
PO_FILES only-process.po
)
+
+
+#
+# ecm_install_po_files_as_qm
+#
+
# 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
# ${CMAKE_INSTALL_LOCALEDIR}
set(CMAKE_INSTALL_LOCALEDIR custom-dir1)
ecm_install_po_files_as_qm(po-custom-dir1)
+
# Should create a bunch of .qm files and install them in
# ${LOCALE_INSTALL_DIR}
set(LOCALE_INSTALL_DIR custom-dir2)
ecm_install_po_files_as_qm(po-custom-dir2)
-# this will be run by CTest
-configure_file(check_tree.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check_tree.cmake" @ONLY)
+unset(CMAKE_INSTALL_LOCALEDIR)
+unset(LOCALE_INSTALL_DIR)
+
+
+
+#
+# ecm_create_qm_loader
+#
+
+find_package(Qt5Core CONFIG REQUIRED)
+ecm_install_po_files_as_qm(tr_test-po)
+
+
+set(tr_test_SRCS
+ tr_test.cpp
+)
+ecm_create_qm_loader(tr_test_SRCS catalog)
+add_executable(tr_test ${tr_test_SRCS})
+target_link_libraries(tr_test PRIVATE Qt5::Core)
+
+
+# This is not something we want people to do (putting the ecm_create_qm_loader
+# call in one CMakeLists.txt file and the target it is used for in another),
+# but it's unfortunately something projects have done and we need to keep them
+# building
+unset(QMLOADER_FILES)
+ecm_create_qm_loader(QMLOADER_FILES catalog)
+assert_var_defined(QMLOADER_FILES)
+add_subdirectory(subdir)
+
+
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/check_conf.cmake"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/check_conf.cmake.in"
+)
+configure_file(check.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/check.cmake" @ONLY)