Qt Creator is messing with "Default Build Directory" setting?
-
I'm not sure why, but this used to be working:
In my global preferences, I have defined the "Default Build Directory" as follows:
../build/%{ActiveProject:Name}/%{Qt:Version}/%{BuildConfig:Name}The project is a
TEMPLATE=subdirsproject usingqmake, and the project file isSBBL.pro. The project is structured like this:SBBL_DEV ├── SBBL_APP │ ├── 3rd_party │ ├── app │ ├──── include │ ├──── src │ ├──── SBBL.pro │ ├──── App.pro │ ├──── Libs.pro (etc.)Since I have things under
appand3rd_partyunder source code management (Fossil) in two different repositories, the idea is that when I build the project, the artifacts will stay outside of the folders which are under Fossil SCM, i.e.:SBBL_DEV ├── SBBL_APP │ ├── 3rd_party │ ├── app │ ├── build │ ├──── SBBL │ ├────── 6.11.0 │ ├──────── Debug │ ├──────── Release │ ├── libs (etc.)When I open the project and examine the value of
%{ActiveProject:Name}, this isSBBLas it should be. However, when I try to configure the project's kits, they all show build paths like this, e.g.:[...]/SBBL_DEV/SBBL_APP/build/6.11.0/Debug [...]/SBBL_DEV/SBBL_APP/build/6.11.0/Release [...]/SBBL_DEV/SBBL_APP/build/6.11.0/ProfileThe
"SBBL"subfolder is missing!As I said, this used to be working correctly. Am I missing something?
-
I fixed this by replacing
"%{ActiveProject:Name}"with just"%{Project:Name}".But how does one know the difference? In the list of variable replacements, they both resolve to
"SBBL". Does this have to do with the"TEMPLATE=subdirs"setting? -
Same problem here, since a while. I can't prove that this came with V18, but it did work properly in the past.
The issue seems to be that during creation of a new project with the assistant the field %{ActiveProject:Name} is not set during project configuration. Therfore the build directories in the build configurations are all set wrong.
If you add a build configuration manually in an already existing project all works as expected.
By the way: the default build path in the preferences (if you click the "reset" button") creates a build directory under the project directory. That's in many areas a no go.
@whomever this concerns: please fix the issue
-
@OliverSo: This is a user forum. Please report bugs at bugreports.qt.io/QTCREATORBUG
Thanks and regards
-
Same problem here, since a while. I can't prove that this came with V18, but it did work properly in the past.
The issue seems to be that during creation of a new project with the assistant the field %{ActiveProject:Name} is not set during project configuration. Therfore the build directories in the build configurations are all set wrong.
If you add a build configuration manually in an already existing project all works as expected.
By the way: the default build path in the preferences (if you click the "reset" button") creates a build directory under the project directory. That's in many areas a no go.
@whomever this concerns: please fix the issue
@OliverSo Thanks, I was beginning to think that nobody else had the same problem.
I believe there is an update for QTC out there; if the bug still persists, I shall file a bug report.
-
Same problem here, since a while. I can't prove that this came with V18, but it did work properly in the past.
The issue seems to be that during creation of a new project with the assistant the field %{ActiveProject:Name} is not set during project configuration. Therfore the build directories in the build configurations are all set wrong.
If you add a build configuration manually in an already existing project all works as expected.
By the way: the default build path in the preferences (if you click the "reset" button") creates a build directory under the project directory. That's in many areas a no go.
@whomever this concerns: please fix the issue
@OliverSo said in Qt Creator is messing with "Default Build Directory" setting?:
The issue seems to be that during creation of a new project with the assistant the field %{ActiveProject:Name} is not set during project configuration. Therfore the build directories in the build configurations are all set wrong.
Interesting ... when I have the project open and go to "Edit->Preferences->Build & Run" and then click on the little symbol in the edit field at the right by "Default Build Directory", I see that
"%{ActiveProject:Name}"is filled in with the correct value. So you must be correct about it happening during creation of a new project. -
The issue with
%{ActiveProject:Name}to be used as a default directory name, is that you need to configure the project to get the%{ActiveProject:Name}.But in order to configure the project, you need the path, which also references the
%{ActiveProject:Name}.%{Project:Name}works because it's being picked from the.proorCMakeLists.txtfile. -
The issue with
%{ActiveProject:Name}to be used as a default directory name, is that you need to configure the project to get the%{ActiveProject:Name}.But in order to configure the project, you need the path, which also references the
%{ActiveProject:Name}.%{Project:Name}works because it's being picked from the.proorCMakeLists.txtfile.@cristian-adam Thanks. So this is the classic "chicken or egg" problem.
I am wondering why this used to work, though?