1

On Qt Creator Tools>Options>Build & Run>Default Build Properties the Default build directory has the value defined in terms of variables

../%{JS: Util.asciify("_build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}")}

which result in something like

_build-Project1-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug
  1. From where those variables (CurrentProject:Name, CurrentKit:FileSystemName and CurrentBuild:Name) come from?

  2. I would like to generate something different (shorter), perhaps like

    _x86-debug or _x86d or _x64-debug or _x64d

which variables should I look for?

KcFnMi
  • 5,516
  • 10
  • 62
  • 136
  • I am searching for something like this, and I would like to add platform to that (win, mac, unix...). Did you come to any conclusion? I think % variables like `CurrentRun:Env:` could help, but I could not find the possible values for ``. – canellas Feb 12 '21 at 15:36

3 Answers3

1

Go to Options/Build & Run/General and it is there as "Default build directory".

Roman Pavelka
  • 3,736
  • 2
  • 11
  • 28
1

If you click on the A->B button near the Reset button and above the tooltip that says "Insert Variable", you'll see a list of the global variables available in Qt Creator

Qt Creator: Build & Run

This is the same list, but easier to read: https://www.programmersought.com/article/73762199051/

And this is the official docs for internal variables: https://doc.qt.io/qtcreator/creator-project-settings-environment.html#using-qt-creator-variables

You could do something like:
../%{JS: Util.asciify("_x64-%{ActiveProjectBuildConfig:Type}")}

Or you could set an environment variable with your architecture, be it x86 or x64, and do:
../%{JS: Util.asciify("_%{Env:ARCH}-%{ActiveProjectBuildConfig:Type}")}


JS is a special variable that enables expression evaluation.
This are the official docs:
https://doc.qt.io/qtcreator/creator-project-wizards.html#using-variables-in-wizards
This answer provides a list of the functions exposed by Qt Creator: https://stackoverflow.com/a/43763489/10996546

Jack Lilhammers
  • 1,207
  • 7
  • 19
1

To see the list, follow these steps:

  • Select menu "Tools" -> "Options"
  • From the "Options" dialog, select "Environment" -> select tab "External Tools"
  • Under "Linguist" -> select "Update Translations (lupdate)"
  • On the right side, click on "Arguments:" editor -> click icon

Now you will see all variables.

Note: Your problem is discussed here. I just summary the steps from the comments.

dqthe
  • 683
  • 5
  • 8