Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.12.2
-
None
Description
translation does not work in a typical cmake dynamic library template:
// заполнитель кода cmake_minimum_required(VERSION 3.14) project(untitled2 LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets LinguistTools REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets LinguistTools REQUIRED) set(TS_FILES untitled2_ru_RU.ts) add_library(untitled2 SHARED untitled2_global.h untitled2.cpp untitled2.h ${TS_FILES} ) target_link_libraries(untitled2 PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) target_compile_definitions(untitled2 PRIVATE UNTITLED2_LIBRARY) if(COMMAND qt_create_translation) qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) else() qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) endif()
untitled2_ru_RU.ts the file is deleted after applying CMAKE
Attachments
Issue Links
- duplicates
-
QTBUG-76410 CMake: Introduce qt_update_translation function
- Closed