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. Building Qt with conan, `qt_add_qml_module` raises error.
Forum Updated to NodeBB v4.3 + New Features

Building Qt with conan, `qt_add_qml_module` raises error.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 273 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.
  • N Offline
    N Offline
    NYBL
    wrote on last edited by
    #1

    Hello I am trying to build Qt from conan (from qt server not conan.io).
    everything is working if i am not using CMake macro qt_add_qml_module if i do i get the following error:

    -- Build files have been written to: /home/nir/Desktop/REPO/Tzv5hob/src/gui/qml/imports/components/build
    [  4%] Running qmlimportscanner for appcomponents
    Segmentation fault (core dumped)
    gmake[2]: *** [CMakeFiles/appcomponents_qmlimportscan.dir/build.make:76: .qt_plugins/Qt6_QmlPlugins_Imports_appcomponents.cmake] Error 139
    gmake[1]: *** [CMakeFiles/Makefile2:322: CMakeFiles/appcomponents_qmlimportscan.dir/all] Error 2
    

    And if i go to the build files and remove line 76 everything builds fine but no qml registration is done.
    Line 76:
    cd /home/nir/Desktop/REPO/Tzv5hob/src/gui/qml/imports/components && /home/nir/.conan/data/qtdeclarative/6.3.1/qt/everywhere/package/2eeb4f8b7db69bab3af991675fc3345821fada87/libexec/qmlimportscanner @/home/nir/Desktop/REPO/Tzv5hob/src/gui/qml/imports/components/build/.qt_plugins/Qt6_QmlPlugins_Imports_appcomponents.rsp

    this is my build script:

    mkdir profiles
    cd profiles
    export use_always_short_paths = True
    conan install qtbuildprofiles/6.3.1@qt/everywhere --update -r  qt
    cd .. 
    mkdir -p build
    cd build
    conan install ..  -r qt --build=missing --profile=../profiles/ci-linux-x86_64-gcc
    cp -R ~/.conan/data/qtbase/6.3.1/qt/everywhere/package/28d78ee0bb26e5fd67dd330450978edf696f7b08/plugins/platforms ./
    source activate.sh
    export QT_QPA_PLATFORM=wayland
    export QT_QPA_PLATFORM=xcb
    export QT_ACCESSIBILITY=1
    export WAYLAND_DISPLAY=wayland-0
    export QT_DEBUG_PLUGINS=0
    cmake --build .   --target clean
    cmake ..  -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_MODULE_PATH=$PWD
    cmake --build .   --target all
    ./appcomponents
    source deactivate.sh
    cd ..
    

    this is my connanFile:

    from conans import ConanFile, CMake
    
    
    class RegexConan(ConanFile):
        name = "components"
        version = "0.0.1"
        # settings = "os", "arch", "compiler", "build_type"
        generators = "cmake_find_package", "virtualenv"
        requires = \
            "qtmultimedia/6.3.1@qt/everywhere", \
            "qtwayland/6.3.1@qt/everywhere", \
            "qtdeclarative/6.3.1@qt/everywhere", \
            "qtbase/6.3.1@qt/everywhere", \
            "qt5compat/6.3.1@qt/everywhere", \
            
    
        def requirements(self):
            ...
    
        def export_sources(self):
            # -> copies all .cpp files from working dir to a "source" dir
            self.copy("*.cpp")
            # -> copies CMakeLists.txt from working dir to a "source" dir
            self.copy("CMakeLists.txt")
    
        def build(self):
            cmake = CMake(self)                # CMake helper auto-formats CLI arguments for CMake
            cmake.configure()                  # cmake -DCMAKE_TOOLCHAIN_FILE=conantoolchain.cmake
            cmake.build()                      # cmake --build .
    
        def package(self):
            # For CMake projects which define an install target, leverage it
            cmake = CMake(self)
            cmake.install()                    # cmake --build . --target=install
            # sets CMAKE_INSTALL_PREFIX = <appropriate directory in conan cache>
    
    
    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