diff options
| author | Alex Merry <alex.merry@kde.org> | 2015-10-14 12:18:40 +0100 |
|---|---|---|
| committer | Alex Merry <alex.merry@kde.org> | 2015-11-14 17:45:29 +0000 |
| commit | 55c55808298986d13ca461d571069f4214d8174d (patch) | |
| tree | 51ad9d3ea9f34d7931e3da4c618050d6425cf0dc /tests/ECMPoQmToolsTest/CMakeLists.txt | |
| parent | c88bc78e0ca3834c46b89ca9d14b404751da5d4a (diff) | |
| download | extra-cmake-modules-55c55808298986d13ca461d571069f4214d8174d.tar.gz extra-cmake-modules-55c55808298986d13ca461d571069f4214d8174d.tar.bz2 | |
Fix multiple calls to ecm_create_qm_loader.
Multiple ecm_create_qm_loader() with different catalog names would
overwrite each other's generated files, causing the wrong catalog to be
loaded at runtime for some targets.
This puts the catalog name into the generated filename. Since the
catalog name is the only difference between the generated files, this is
sufficient to fix the runtime behaviour.
REVIEW: 125999
Diffstat (limited to 'tests/ECMPoQmToolsTest/CMakeLists.txt')
| -rw-r--r-- | tests/ECMPoQmToolsTest/CMakeLists.txt | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/tests/ECMPoQmToolsTest/CMakeLists.txt b/tests/ECMPoQmToolsTest/CMakeLists.txt index 76d80141..73d2b427 100644 --- a/tests/ECMPoQmToolsTest/CMakeLists.txt +++ b/tests/ECMPoQmToolsTest/CMakeLists.txt @@ -12,9 +12,11 @@ include(ECMPoQmTools) include(../test_helpers.cmake) -# -# ecm_process_po_files_as_qm -# +############################## +# # +# ecm_process_po_files_as_qm # +# # +############################## # Should create a process-and-install.qm file and install it @@ -30,9 +32,11 @@ ecm_process_po_files_as_qm(fr ALL -# -# ecm_install_po_files_as_qm -# +############################## +# # +# 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 @@ -56,14 +60,19 @@ unset(LOCALE_INSTALL_DIR) -# -# ecm_create_qm_loader -# +######################## +# # +# ecm_create_qm_loader # +# # +######################## find_package(Qt5Core CONFIG REQUIRED) ecm_install_po_files_as_qm(tr_test-po) +# +# single-threaded test +# set(tr_test_SRCS tr_test.cpp ) @@ -72,10 +81,24 @@ 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 +# +# single-threaded test (different catalog name) +# +# This is to check we don't overwrite previously-generated files. +set(tr_test_2_SRCS + tr_test.cpp +) +ecm_create_qm_loader(tr_test_2_SRCS catalog2) +add_executable(tr_test_2 ${tr_test_2_SRCS}) +target_link_libraries(tr_test_2 PRIVATE Qt5::Core) + + +# +# call to ecm_create_qm_loader is in a different CMakeLists.txt to where +# the target it is added to is defined +# +# This is not something we want people to do, 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) |
