qt_add_big_resources not producing promissed .o file
-
Hi,
When usingqt_add_big_resources
on the same CMake level in which the target is defined, everything works fine. If howeverqt_add_big_resources
is called in a subdirectory (included in CMake) and later added to the executable target withtarget_sources
, CMake complains about a missing .o file. Indeed, the .o file is not existing in the file system but the variable (first parameter to qt_add_big_resources) contains the extected path to the .o file.Is this a known limitation of
qt_add_big_resources
or does the .o generation process can be triggered through something else?AUTORCC
is set toON
.Thx,
Andi -
Hi,
You should post a minimal project that shows your issue.
-
Hi Andreas,
as @SGaist said, a minimal reproducer would help a lot.
You could narrow things down in parallel, by adding a small random file withqt_add_resources
. If that works, file a bug report. If it doesn't, paths are mangled. -
Hi @SGaist @Axel-Spoerl ,
here is minimal example:
We would expect that it works as well if we outsource the qt_add_qml_module in a subdirectory (resources)
cmake_minimum_required(VERSION 3.16) project(big_resources_showcase_app LANGUAGES CXX) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) find_package(Qt6 REQUIRED COMPONENTS Quick) #qt_add_big_resources(BIG_RESOURCE resources/big_resource.qrc) qt_add_executable(${PROJECT_NAME} #${BIG_RESOURCE} src/main.cpp ) qt_add_qml_module(${PROJECT_NAME} URI modules QML_FILES resources/Window.qml ) add_subdirectory("resources") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17 ) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Quick )
resources/CMakeLists.txt
qt_add_big_resources(BIG_RESOURCE big_resource.qrc) target_sources(${PROJECT_NAME} PRIVATE ${BIG_RESOURCE} )
Any idea what we are doing wrong? Thanks a lot.
-
Hi @SGaist @Axel-Spoerl ,
here is minimal example:
We would expect that it works as well if we outsource the qt_add_qml_module in a subdirectory (resources)
cmake_minimum_required(VERSION 3.16) project(big_resources_showcase_app LANGUAGES CXX) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) find_package(Qt6 REQUIRED COMPONENTS Quick) #qt_add_big_resources(BIG_RESOURCE resources/big_resource.qrc) qt_add_executable(${PROJECT_NAME} #${BIG_RESOURCE} src/main.cpp ) qt_add_qml_module(${PROJECT_NAME} URI modules QML_FILES resources/Window.qml ) add_subdirectory("resources") target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17 ) target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Quick )
resources/CMakeLists.txt
qt_add_big_resources(BIG_RESOURCE big_resource.qrc) target_sources(${PROJECT_NAME} PRIVATE ${BIG_RESOURCE} )
Any idea what we are doing wrong? Thanks a lot.
@Mr_Gruber The code files are missing,
big_resource.qrc
as well. These might seem details but without them, we won't be able to replicate your situation. -
Since I'm not allowed to attach files here, I've uploaded it to Google. Hope that works:
https://drive.google.com/file/d/1zcEmt09gpg8CxYdbvb1oW_P3tbc1LHxF/view?usp=drive_link