QtLinguist¶
Qt Linguist, from collecting the strings to releasing the catalogues.
- qm_add_translation¶
Add qt translation target.
qm_add_translation(<target> [LOCALES locales] [PREFIX prefix] [SOURCES files... | DIRECTORIES dirs... | TARGETS targets... | TS_FILES files...] [TS_DIR dir] [QM_DIR dir] [TS_OPTIONS options...] [QM_OPTIONS options...] [TS_DEPENDS targets...] [QM_DEPENDS targets...] [CREATE_ONCE] )
LOCALESlanguage names, e.g. zh_CN en_US, must specify if SOURCES or TARGETS is specified
PREFIXtranslation file prefix, default to target name
SOURCESsource files
DIRECTORIESsource directories
TARGETStarget names, the source files of which will be collected
TS_FILESts file names, add the specified ts file
TS_DIRts files destination, default to
CMAKE_CURRENT_SOURCE_DIRQM_DIRqm files destination, default to
CMAKE_CURRENT_BINARY_DIRTS_DEPENDSadd lupdate task as a dependency to the given targets
QM_DEPENDSadd lrelease task as a dependency to the given targets
CREATE_ONCEcreate translations at configure phase if not exist
Note
The Linguist tools have to be found before this is called, which
qm_find_qt()is the short way to. A call made without them stops with an error saying so.qm_import(QtLinguist) qm_find_qt(LinguistTools) qm_add_translation(${PROJECT_NAME}_translations LOCALES ja_JP zh_CN zh_TW PREFIX ${PROJECT_NAME} TARGETS ${PROJECT_NAME} TS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/translations QM_DIR ${CMAKE_CURRENT_BINARY_DIR}/translations )
Where this page comes from
The comments in cmake/modules/QtLinguist.cmake, which is what to change.