How to make LinguistTools work in CMakeLists.txt?
Solved
General and Desktop
-
Env
Linux
Qt6Code
CMakeLists.txt
... find_package(Qt${QT_VERSION} COMPONENTS ${REQUIRED_LIBS} LinguistTools REQUIRED) set(TS_FILES ./translations/zh_CN.ts ./translations/zh_TW.ts) qt6_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${TS_FILES}) ...
demo.cpp
return tr(u8"hello");
Problem
Both cmake generation and building passed, but no
.ts
or.qm
file has been generated.
What's the problem? -
See e.g. here: https://forum.qt.io/topic/114773