Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtQuick Compiler in CMake
Forum Updated to NodeBB v4.3 + New Features

QtQuick Compiler in CMake

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 1.2k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    Larvae
    wrote on last edited by Larvae
    #1

    Hi,

    I put my QML files into a separate qrc/rcc file in a cmake projekt:

    qt5_add_binary_resources("res" "qml.qrc" DESTINATION "qml.rcc")
    

    This works fine so far. Now I wanted to precompile them. According to this I only need to change

    qt5_add_resources(RESOURCES example.qrc)
    add_executable(myapp ${SRC_LIST} ${RESOURCES)
    

    to

    find_package(Qt5QuickCompiler)
    qtquick_compiler_add_resources(RESOURCES example.qrc)
    add_executable(myapp ${SRC_LIST} ${RESOURCES)
    

    So I changed my CMakeLists.txt to

    find_package(Qt5QuickCompiler)
    qtquick_compiler_add_resources("QML_RESOURCE" "qml.qrc")
    qt5_add_binary_resources("res" ${QML_RESOURCE} DESTINATION "qml.rcc")
    

    But now I get
    FAILED: qml.rcc cmd.exe /C "cd /D "D:\buildPath" && C:\Qt\5.12.3\msvc2017_64\bin\rcc.exe --binary --name res --output qml.rcc "D:/buildPath/main_qml.cpp" "D:/buildPath/qmlcache_loader.cpp""

    RCC Parse Error: 'D:/buildPath/main_qml.cpp' Line: 1 Column: 1 [Start tag expected.] [2/4 30.3/sec] Automatic MOC for target PROJECT_NAME ninja: build stopped: subcommand failed.

    17:10:39: The process "C:\Program Files\CMake\bin\cmake.exe" exited with code 1. Error while building/deploying project PROJECT_NAME (kit: Desktop Qt 5.12.3 MSVC2017 64bit) When executing step "Build with CMake"

    There isn't much information about Qt and CMake, so I'm not sure if there is something wrong in my script/Setup or if it's something else. I hope someone can give me some advice.

    ps: I'm using QtCreator 4.9.1, Windows 10 and Qt 5.12.3

    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