Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-26147

Variable for active build system for Default build directory

    XMLWordPrintable

    Details

    • Platform/s:
      All
    • Commits:
      939cc5af218b041daa1519f26b6ada18572a7cf5

      Description

      I'm writing the cmake build for my qmake library project and I have discovered that when I open the same project ( eg. I have a qmake project ) like eg. cmake project, then Qt Creator overwrites or writes cmake build directory to the qmake's build directory because by default both build directories have the same path.

      Example:

      Currently the Default build directory template is something like this:

      [Directories]
      BuildDirectory.Template=../%{CurrentProject:Name}-builds/build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}
      

      When I open qmake project, then QtCreator creates a build directory at: 

      E:/c/example-project/../build-example-project-Desktop_Qt_6_1_1_MSVC2019_64bit-Debug
      

      Then I open another QtCreator instance and open cmake project and QtCreator creates a build directory at: 

      E:/c/example-project/../build-example-project-Desktop_Qt_6_1_1_MSVC2019_64bit-Debug
      

      It is the same build directory.

      QtCreator doesn't provide any variable for the user to distinguish these build directories by the active build system.

      Would be nice to have eg. ActiveProject:BuildSystem:Name variable that will contain the name of an active build system: cmake, qmake, qbs, ...

      So user can change the Default Build Directory to something like this:

      [Directories]
      BuildDirectory.Template=../%{CurrentProject:Name}-builds/build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}-%{BuildSystem:Name}
      

      And QtCreator will generate path like this for cmake:

      E:/c/example-project/../build-example-project-Desktop_Qt_6_1_1_MSVC2019_64bit-Debug-cmake
      

      or this for qmake:

      E:/c/example-project/../build-example-project-Desktop_Qt_6_1_1_MSVC2019_64bit-Debug-qmake
      

      For now, I didn't find any satisfactory variable to use for this.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kandeler Christian Kandeler
            Reporter:
            silverq Silver Zachara
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes