Qt6 CMake qt_add_resources with LANG why does order matter ?
-
I am doing some tests with Qt6 and CMake and while attempting to load I18N resources in my project I was faced with a strange behaviour I can't comprehend.
When I try to include my resources like so:
qt_add_resources( cmake_qt6_sample_project "images_fr" LANG "fr" BASE "${CMAKE_CURRENT_SOURCE_DIR}/assets/fr" FILES "${CMAKE_CURRENT_SOURCE_DIR}/assets/fr/images/doge.jpg" ) qt_add_resources( cmake_qt6_sample_project "images" BASE "${CMAKE_CURRENT_SOURCE_DIR}/assets" FILES "${CMAKE_CURRENT_SOURCE_DIR}/assets/images/doge.jpg" )
I can switch my locale FR to get the French picture with
QPixmap background {u":/images/doge.jpg"_s};
But if I switch the order in the CMakeLists like that:
qt_add_resources( cmake_qt6_sample_project "images" BASE "${CMAKE_CURRENT_SOURCE_DIR}/assets" FILES "${CMAKE_CURRENT_SOURCE_DIR}/assets/images/doge.jpg" ) qt_add_resources( cmake_qt6_sample_project "images_fr" LANG "fr" BASE "${CMAKE_CURRENT_SOURCE_DIR}/assets/fr" FILES "${CMAKE_CURRENT_SOURCE_DIR}/assets/fr/images/doge.jpg" )
There is no way for me to get the French picture.
Is there a reason/something I missed in the documentation explaining that behaviour. Did I do something wrong ?
-
Hi,
Which version of Qt are you using ?
-
Would it be possible to provide a minimal compilable project to study that behavior ?