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. adding git branch name to build directory name
Forum Updated to NodeBB v4.3 + New Features

adding git branch name to build directory name

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
7 Posts 3 Posters 1.0k Views 2 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.
  • M Offline
    M Offline
    mzimmers
    wrote on 3 Jun 2021, 16:00 last edited by mzimmers 6 Mar 2021, 16:31
    #1

    Hi -

    I'm working on a project that requires relatively frequent branch changes on github. Most of the time, when I change a branch, I end up rebuilding most of my project (a process that takes about 7-8 minutes). I think if I retained a build directory for each branch, this would not be the case.

    Have any of you done this? My build directory name is based on:

    ../%{JS: Util.asciify("build-%{Project:Name}-%{Kit:FileSystemName}-%{BuildConfig:Name}")}
    

    Thanks...

    EDIT: marking this solved, but it isn't really solved - Christian pointed out that my idea of a solution won't work, so answers are no longer necessary.

    1 Reply Last reply
    0
    • C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 3 Jun 2021, 16:17 last edited by Christian Ehrlicher 6 Mar 2021, 16:17
      #2

      @mzimmers said in adding git branch name to build directory name:

      this would not be the case.

      It's also the case since git does/can not restore the file modification time when switching to another branch.
      Simply use more than one source directory.

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

      M 1 Reply Last reply 3 Jun 2021, 16:30
      0
      • C Christian Ehrlicher
        3 Jun 2021, 16:17

        @mzimmers said in adding git branch name to build directory name:

        this would not be the case.

        It's also the case since git does/can not restore the file modification time when switching to another branch.
        Simply use more than one source directory.

        M Offline
        M Offline
        mzimmers
        wrote on 3 Jun 2021, 16:30 last edited by
        #3

        @Christian-Ehrlicher that's not an ideal solution for this particular implementation, in that this would entail changing projects. I'm sure some CMake mavens could work out a way to change source directories without changing projects, but that's above my pay grade.

        But your point about file modification times is certainly valid, so I guess my idea won't work either. Closing this thread accordingly.

        1 Reply Last reply
        0
        • C Online
          C Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 3 Jun 2021, 16:33 last edited by
          #4

          You can maybe use something like ccache or inrcedibuild.

          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
          1
          • S Offline
            S Offline
            SimonSchroeder
            wrote on 4 Jun 2021, 07:17 last edited by
            #5

            I'd like to add to @Christian-Ehrlicher's answer: I once played around with ccache, incredibuild and other tools. I ended up using FASTBuild which allows to combine pre-compiled headers, caching, distributed builds and unity files. Caching will help you a lot when you are switching between branches. Unity files merges multiple files into one to cut down on compilation time. The combination of all features can speed up compilation times by a lot. On GitHub you'll find a bunch of scripts that will help you get started with a FASTBuild setup based on an existing qmake file: https://github.com/SimonSchroeder/QMake2Fastbuild.

            M 1 Reply Last reply 4 Jun 2021, 15:26
            0
            • S SimonSchroeder
              4 Jun 2021, 07:17

              I'd like to add to @Christian-Ehrlicher's answer: I once played around with ccache, incredibuild and other tools. I ended up using FASTBuild which allows to combine pre-compiled headers, caching, distributed builds and unity files. Caching will help you a lot when you are switching between branches. Unity files merges multiple files into one to cut down on compilation time. The combination of all features can speed up compilation times by a lot. On GitHub you'll find a bunch of scripts that will help you get started with a FASTBuild setup based on an existing qmake file: https://github.com/SimonSchroeder/QMake2Fastbuild.

              M Offline
              M Offline
              mzimmers
              wrote on 4 Jun 2021, 15:26 last edited by
              #6

              @SimonSchroeder I took a closer look at ccache; it seems like it might be what I need. (The project in question is using cmake.) Is there an option in creator to prefix the actual compile command, or do I need to create soft links per the instructions?

              Thanks...

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SimonSchroeder
                wrote on 7 Jun 2021, 09:11 last edited by
                #7

                I assume that you create a new Kit in Creator which uses ccache as its compiler. (I.e. first add ccache manually as a compiler in the compiler tab, then copy an existing kit and select the corresponding compiler instead.)

                1 Reply Last reply
                0

                1/7

                3 Jun 2021, 16:00

                • Login

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