Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Build & install multiple qt versions efficiently out of sources
Forum Update on Monday, May 27th 2025

Build & install multiple qt versions efficiently out of sources

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
6 Posts 4 Posters 521 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.
  • _ Offline
    _ Offline
    _BPL_
    wrote on 9 Aug 2023, 13:00 last edited by
    #1

    Hi guys,

    I'd like to build multiple qt versions from sources as efficiently as possible on a windows machine.

    Here's the typical workflow for a single build out of a clean checkout of qtbase

    cd D:\sources\lib\qtbase\build
    D:\sources\lib\qtbase\src\configure.bat -prefix "D:\sources\lib\qtbase\dist\6.0.0-beta5-13543-gbc88bb34ca\msvc2022_x64" -opensource -confirm-license -nomake examples -nomake tests -opengl dynamic
    cmake --build . --parallel
    ninja install
    cd D:\sources\lib\qtbase\src
    git checkout -- . && git clean -fdx
    

    My question is, if now I was going to checkout a different version of the source repo and reconfigure again with a different prefix in the same build dir and building again, would that lead to inconsistencies?

    Said otherwise, what's the more robust&safe way to build & install multiple versions of qt out of sources? Of course the premise here is to avoid making cold builds on each checkout.

    C 1 Reply Last reply 9 Aug 2023, 13:14
    0
    • _ _BPL_
      9 Aug 2023, 13:00

      Hi guys,

      I'd like to build multiple qt versions from sources as efficiently as possible on a windows machine.

      Here's the typical workflow for a single build out of a clean checkout of qtbase

      cd D:\sources\lib\qtbase\build
      D:\sources\lib\qtbase\src\configure.bat -prefix "D:\sources\lib\qtbase\dist\6.0.0-beta5-13543-gbc88bb34ca\msvc2022_x64" -opensource -confirm-license -nomake examples -nomake tests -opengl dynamic
      cmake --build . --parallel
      ninja install
      cd D:\sources\lib\qtbase\src
      git checkout -- . && git clean -fdx
      

      My question is, if now I was going to checkout a different version of the source repo and reconfigure again with a different prefix in the same build dir and building again, would that lead to inconsistencies?

      Said otherwise, what's the more robust&safe way to build & install multiple versions of qt out of sources? Of course the premise here is to avoid making cold builds on each checkout.

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 9 Aug 2023, 13:14 last edited by Christian Ehrlicher 8 Sept 2023, 13:15
      #2

      Simply install the different qt versions into different directories as it's done by the Qt online installer.
      Use out-of-source builds for every own qt version you check out.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      _ 1 Reply Last reply 9 Aug 2023, 13:33
      0
      • C Christian Ehrlicher
        9 Aug 2023, 13:14

        Simply install the different qt versions into different directories as it's done by the Qt online installer.
        Use out-of-source builds for every own qt version you check out.

        _ Offline
        _ Offline
        _BPL_
        wrote on 9 Aug 2023, 13:33 last edited by
        #3

        @Christian-Ehrlicher When you say out-of-source builds for every own qt version you check out.... what do you mean? I'd like to know how to avoid cold builds as much as possible as this is a really expensive operation.

        For instance, let's say i'd like to build a set of versions {6.5, 6.5.0, 6.5.1, 6.5.2} , in this case, can't i reuse the same out-of-source build directory? Do I need to create an specific build directory from scratch for each one of them?

        I mean, I know if i was going to create from scratch build_65, build_650, build_651, build_652 where each of them would use a different prefix that'd give me artifacts with no problems. The problem of this approach is each cold build will be really expensive so I'd like to know
        how to avoid those as much as possible.

        In fact, let me ask it differently... if you're git bisecting, what's the typical workflow to do it effectively?

        C 1 Reply Last reply 9 Aug 2023, 13:48
        0
        • _ _BPL_
          9 Aug 2023, 13:33

          @Christian-Ehrlicher When you say out-of-source builds for every own qt version you check out.... what do you mean? I'd like to know how to avoid cold builds as much as possible as this is a really expensive operation.

          For instance, let's say i'd like to build a set of versions {6.5, 6.5.0, 6.5.1, 6.5.2} , in this case, can't i reuse the same out-of-source build directory? Do I need to create an specific build directory from scratch for each one of them?

          I mean, I know if i was going to create from scratch build_65, build_650, build_651, build_652 where each of them would use a different prefix that'd give me artifacts with no problems. The problem of this approach is each cold build will be really expensive so I'd like to know
          how to avoid those as much as possible.

          In fact, let me ask it differently... if you're git bisecting, what's the typical workflow to do it effectively?

          C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 9 Aug 2023, 13:48 last edited by
          #4

          @_BPL_ said in Build & install multiple qt versions efficiently out of sources:

          n fact, let me ask it differently... if you're git bisecting, what's the typical workflow to do it effectively?

          If you just want to build different versions start with the lowest but you will Mostly rebuild everything due to the different version number in qglobal.h

          For bisecting I only build the Qt module of interest and then also only the interesting targets. But that's not what you asked in the first place.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SimonSchroeder
            wrote on 10 Aug 2023, 07:22 last edited by
            #5

            There is one major problem why a build might be slow on Windows. If you execute the build command inside a console window it will build much faster if you minimize the window. As long as all output is visible on the screen your build will be slow. With a minimized console window on Windows I wouldn't complain too much about the build time of Qt.

            J 1 Reply Last reply 10 Aug 2023, 09:04
            0
            • S SimonSchroeder
              10 Aug 2023, 07:22

              There is one major problem why a build might be slow on Windows. If you execute the build command inside a console window it will build much faster if you minimize the window. As long as all output is visible on the screen your build will be slow. With a minimized console window on Windows I wouldn't complain too much about the build time of Qt.

              J Offline
              J Offline
              JonB
              wrote on 10 Aug 2023, 09:04 last edited by
              #6

              @SimonSchroeder
              I am surprised! If the issue is the speed at which output is produced, and has to be scrolled in a console window, I would have thought no matter how voluminous the time would be miniscule in comparison to the time required to compile Qt! Not doubting your finding, but inexplicable to me :)

              1 Reply Last reply
              0

              1/6

              9 Aug 2023, 13:00

              • Login

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