File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,20 @@ set(LAUNCHER_LINGUIST_RESOURCES "")
3535if (Qt6LinguistTools_FOUND)
3636 file (GLOB TS_FILES "${CMAKE_CURRENT_SOURCE_DIR} /*.ts" )
3737 qt6_create_translation(QM_FILES ${CMAKE_CURRENT_SOURCE_DIR} ${TS_FILES} )
38- configure_file (translations.qrc ${CMAKE_CURRENT_BINARY_DIR} COPYONLY )
39- set (LAUNCHER_LINGUIST_RESOURCES ${CMAKE_CURRENT_BINARY_DIR} /translations.qrc ${QM_FILES} )
38+ # Generate a .qrc file dynamically
39+ set (QRC_FILE "${CMAKE_CURRENT_BINARY_DIR} /translations.qrc" )
40+
41+ file (WRITE ${QRC_FILE} "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n " )
42+ file (APPEND ${QRC_FILE} "<RCC>\n " )
43+ file (APPEND ${QRC_FILE} " <qresource prefix=\" /translations\" >\n " )
44+ foreach (TS_FILE IN LISTS QM_FILES)
45+ # Extract just the filename (basename)
46+ get_filename_component (TS_BASENAME "${TS_FILE} " NAME )
47+ file (APPEND ${QRC_FILE} " <file>${TS_BASENAME} </file>\n " )
48+ endforeach ()
49+ file (APPEND ${QRC_FILE} " </qresource>\n " )
50+ file (APPEND ${QRC_FILE} "</RCC>\n " )
51+ set (LAUNCHER_LINGUIST_RESOURCES ${QRC_FILE} ${QM_FILES} )
4052endif ()
4153
4254qt6_add_resources(RESOURCES qml.qrc)
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments