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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by mzimmers
    #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
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by Christian Ehrlicher
      #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

      mzimmersM 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @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.

        mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on 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
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 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 Online
            S Online
            SimonSchroeder
            wrote on 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.

            mzimmersM 1 Reply Last reply
            0
            • S SimonSchroeder

              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.

              mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on 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 Online
                S Online
                SimonSchroeder
                wrote on 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

                • Login

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