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

Add Variable Project:DirectoryBaseName

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • None
    • None
    • All

      Hello.
      Qt Creator's settings control the default build directory. This can be specified using Qt Creator variables.
      I use this line for this:

      %{Env:HOMEDRIVE}%{Env:HOMEPATH}/build-%{Asciify:%{Project:Name}-%{Kit:FileSystemName}-%{BuildConfig:Name}}

      Sometimes, it's necessary to maintain multiple copies of the project source directory, as the project takes a long time to build and you need to work on several branches at once. Therefore, it's easier to do this in different directories and have two build directories. For example:
      MyProject/
      MyProject2/
       
      And, accordingly, the build directories:
      build-MyProject/
      build-MyProject2/
       
      The inconvenience is that, with this line specified in the default build directory settings, when opening a project, Qt Creator tries to use the name "MyProject" as %{Project:Name} in both cases. Therefore, when opening a project from the MyProject2/ directory, I get the directory:
      build-MyProject/, not build-MyProject2/ as I want.
       
      In this case, it would be very useful if Qt Creator had a variable among its possible substitution variables that is the base name of the directory (i.e., without paths and slashes) containing the project's sources, for example, Project:DirectoryBaseName. Please note that this variable should not be part of the ActiveProject group variables, as they have no effect on the project opened for the first time on the initial build directory selection screen. It's better to make it part of the Project group.

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

            kandeler Christian Kandeler
            rumgot rumgot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes