Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. qt_add_big_resources not producing promissed .o file
Forum Update on Monday, May 27th 2025

qt_add_big_resources not producing promissed .o file

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 4 Posters 876 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andreas Schacherbauer
    wrote on last edited by
    #1

    Hi,
    When using qt_add_big_resources on the same CMake level in which the target is defined, everything works fine. If however qt_add_big_resources is called in a subdirectory (included in CMake) and later added to the executable target with target_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 to ON.

    Thx,
    Andi

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You should post a minimal project that shows your issue.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      Axel SpoerlA 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        You should post a minimal project that shows your issue.

        Axel SpoerlA Offline
        Axel SpoerlA Offline
        Axel Spoerl
        Moderators
        wrote on last edited by
        #3

        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 with qt_add_resources. If that works, file a bug report. If it doesn't, paths are mangled.

        Software Engineer
        The Qt Company, Oslo

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mr_Gruber
          wrote on last edited by
          #4

          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.

          SGaistS 1 Reply Last reply
          0
          • M Mr_Gruber

            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.

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @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.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Mr_Gruber
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved