qmake include() NOT work in the brakets scope
-
Hi guys ,
Windows10 + Qt5.14.1
I want to include some pri in some condition, but it not work, why?
just give pictures:When not use condition(a variable):
When use condition:
From the file tree, it seems include() always works in any condition!!!
-
Hi guys ,
Windows10 + Qt5.14.1
I want to include some pri in some condition, but it not work, why?
just give pictures:When not use condition(a variable):
When use condition:
From the file tree, it seems include() always works in any condition!!!
@QtTester said in qmake include() NOT work in the brakets scope:
From the file tree, it seems include() always works in any condition!!!
Because you have if..else, so either project1 or project2 is included (this is also visible in the output you posted). So, I don't see any issue here.
-
@QtTester said in qmake include() NOT work in the brakets scope:
From the file tree, it seems include() always works in any condition!!!
Because you have if..else, so either project1 or project2 is included (this is also visible in the output you posted). So, I don't see any issue here.
@jsulm
we can see the message only output in the right if/else.
not both message(project1/project2).
So in the file tree, it should only include the right "Projectx.pri",in "both include" situation, we cannot know which pri is included and worked.
Right?
-
@jsulm
we can see the message only output in the right if/else.
not both message(project1/project2).
So in the file tree, it should only include the right "Projectx.pri",in "both include" situation, we cannot know which pri is included and worked.
Right?
-
@QtTester So, you're basically asking why QtCreator shows both projects in project tree, right? What QtCreator version do you use?
-
I had the same grievances
let me forward the answer I got from customer support:
Qt Creator behavior differs from how qmake actually works because they have different goals
Qt Creator parses qmake files so that it takes all available code paths. That is to make sure the whole project including possible platform specific files/projects are visible in editor.
Not a really satisfying answer, especially as it is inconsistent behaviour. For example android scoped DISTFILES don't show up in QtCreator ProjectView.
But it's as it is, "working as intended"
-
@QtTester I'm not sure but I think QtCreator will only show source code files for the project which is active, so try to add some source code files to project1 and project2 and see what is shown then.
-
@jsulm
Source files are correctly included. but pri is not hided with inactive property.
In my project, file is not added in pri, just some variables are declared.
maybe it's a QC bug ?@QtTester said in qmake include() NOT work in the brakets scope:
Source files are correctly included. but pri is not hided with inactive property.
At least you can see which project is active (the one where you also see source files).
-
@QtTester said in qmake include() NOT work in the brakets scope:
Source files are correctly included. but pri is not hided with inactive property.
At least you can see which project is active (the one where you also see source files).