qt5_create_translation does not update .ts
-
How do you use them? Please show your CMakeLists.txt.
And do you really use Qt5? -
How do you use them? Please show your CMakeLists.txt.
And do you really use Qt5?@Christian-Ehrlicher
CMakeLists.txt https://paste.opensuse.org/pastes/3b20e7f51bbd
main.cpp https://paste.opensuse.org/pastes/f3f943334115
The demo project has this two files only. I open this project with qtcreator and configure it with Qt5 KitsAnd if you add message("lupdate = ${Qt5_LUPDATE_EXECUTABLE}") to CMakeLists.txt, it will show something like Qt5:lupdate, that's may be the real cause
-
@Christian-Ehrlicher
CMakeLists.txt https://paste.opensuse.org/pastes/3b20e7f51bbd
main.cpp https://paste.opensuse.org/pastes/f3f943334115
The demo project has this two files only. I open this project with qtcreator and configure it with Qt5 KitsAnd if you add message("lupdate = ${Qt5_LUPDATE_EXECUTABLE}") to CMakeLists.txt, it will show something like Qt5:lupdate, that's may be the real cause
@Sauntor said in qt5_create_translation does not update .ts:
, it will show something like Qt5:lupdate, that's may be the real cause
No, that's correct.
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
You don't do anything with the qm files so nothing will happen. You have to add them to a target.
But I would not use deprecated functions but qt_add_translations()
-
@Sauntor said in qt5_create_translation does not update .ts:
, it will show something like Qt5:lupdate, that's may be the real cause
No, that's correct.
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
You don't do anything with the qm files so nothing will happen. You have to add them to a target.
But I would not use deprecated functions but qt_add_translations()
@Christian-Ehrlicher Qt5's cmake modules does not provide the qt_add_translations() command, it's added in Qt6.
qt5_create_translation() does not generate a cmake target, so, how to add it to my executable target?
PS:
If you runlupdate CMakeLists.txt
, it will output something likelupdate warning: no TS files specified. Only diagnostics will be produced.
. Is it the problem? Or we can say thatqt5_create_translation()
depends on the qmake project file(.pro
)? -
@Christian-Ehrlicher Qt5's cmake modules does not provide the qt_add_translations() command, it's added in Qt6.
qt5_create_translation() does not generate a cmake target, so, how to add it to my executable target?
PS:
If you runlupdate CMakeLists.txt
, it will output something likelupdate warning: no TS files specified. Only diagnostics will be produced.
. Is it the problem? Or we can say thatqt5_create_translation()
depends on the qmake project file(.pro
)?@Sauntor said in qt5_create_translation does not update .ts:
how to add it to my executable target?
The same way you added the ts files in your add_executable call.
Don't know why you don't use the new macros since you use Qt6 in your provided example though.
-
@Sauntor said in qt5_create_translation does not update .ts:
how to add it to my executable target?
The same way you added the ts files in your add_executable call.
Don't know why you don't use the new macros since you use Qt6 in your provided example though.
@Christian-Ehrlicher it already in:
add_executable(tsdemo main.cpp ${TS_FILES} images.qrc )
-
@Sauntor said in qt5_create_translation does not update .ts:
how to add it to my executable target?
The same way you added the ts files in your add_executable call.
Don't know why you don't use the new macros since you use Qt6 in your provided example though.
@Christian-Ehrlicher said in qt5_create_translation does not update .ts:
Don't know why you don't use the new macros
I'm try compile my project with qt5 only, so the new macros are not avaliable.