-
Task
-
Resolution: Duplicate
-
P2: Important
-
None
-
None
-
None
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.
- duplicates
-
QTCREATORBUG-33205 Add %{Project:SourceDirName} or similar persistent, documented variable
-
- Closed
-