Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Copying a qt5 build to a different host machine
Qt 6.11 is out! See what's new in the release blog

Copying a qt5 build to a different host machine

Scheduled Pinned Locked Moved Solved QtonPi
3 Posts 2 Posters 2.1k 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.
  • vikramgV Offline
    vikramgV Offline
    vikramg
    wrote on last edited by
    #1

    I have successfully cross-built qt5 for the Odroid C2 in a qt5-build directory on an Ubuntu x86-64 host machine. (Configured thus:

    -sysroot ~/Projects/Odroid/C2/sysroot 
    -prefix /usr/local/qt5c2 
    -hostprefix ~/Projects/Odroid/C2/Qt/qt5-build
    

    )
    This works fine, and I am able to build and deploy an application on the target device via Qt Creator. I want to enable another host machine (also Ubuntu x86-64) to facilitate development, and thought the process would be as simple as copying my qt5-build directory to the second host.

    To my surprise, this does not work at all, owing to hardcoded paths in various places. Per this SO post I tried creating a qt.conf with

    [Paths]
    Prefix = ./../
    

    With this, "qmake -query" does return the correct paths. However, QtCreator still barfs when I try to select this qmake as my desired Qt version.

    Then I tried "qmake -set" as suggested in another post in the same SO thread:

    $ ./qmake -set QT_HOST_PREFIX /opt/Qt/Odroid-C2/qt5-build
    $ ./qmake -set QT_SYSROOT ~/Projects/Odroid/C2/sysroot
    

    (The paths here are correct for the new host machine I wish to enable).
    However, it still does not work in QtCreator.

    So: how does one copy/move a Qt build from one host machine to another? Surely it should not require rebuilding Qt from source on every host I'd like to enable. One workaround I can think of is to build on the original host with generic paths under /opt wherever path specification is required, and replicate that structure on all other hosts. But it just feels like there ought to be a real solution to this rather than workarounds.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      The official recommendation is not to copy the libs after building. The way Qt installers go around it is indeed by using qt.conf.

      I guess the easiest way is indeed to preserve the same paths in all machines. Not very convenient, but will work.

      (Z(:^

      vikramgV 1 Reply Last reply
      1
      • sierdzioS sierdzio

        The official recommendation is not to copy the libs after building. The way Qt installers go around it is indeed by using qt.conf.

        I guess the easiest way is indeed to preserve the same paths in all machines. Not very convenient, but will work.

        vikramgV Offline
        vikramgV Offline
        vikramg
        wrote on last edited by
        #3

        I have verified that preserving the same paths (in my case, /opt/Qt) on all hosts for the cross-compiled output, works fine.

        1 Reply Last reply
        1

        • Login

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