[Interest] QMake contains and include

Jérôme Godbout godboutj at amotus.ca
Wed May 20 19:39:50 CEST 2020


Sorry about that, yeah it's QtCreator, I figure out it was displaying the unused .pri along all the file inclusion of it. At first I was thinking it was including the .pri straight since I could see it, then I realized the source, headers and resources files was gray out, which seem to indicate it won't be used. The compiler seem to do the right thing. It was very confusing to see the non included .pri showing up along their content.

If I may, why I want that in QtCreator exactly? what is the use case for this? If my project doesn't use a part, why is it parsed at all? What will happen if that unused .pri make a failure for something missing? Will it failed to load the project and stop? let's say I have an option that require an interaction with another subrepos, one project might not need that part and not have it checkout, the .pri that interact with it would not be include, how would QtCreator react to this?

Thanks,

-----Original Message-----
From: Interest <interest-bounces at qt-project.org> On Behalf Of Thiago Macieira
Sent: May 20, 2020 1:23 PM
To: interest at qt-project.org
Subject: Re: [Interest] QMake contains and include

On Wednesday, 20 May 2020 09:30:41 PDT Jérôme Godbout wrote:
> It kinda work, it’s really weird, but all the project get display, the 
> .pri and the include/source no matter the condition, but they are grey 
> out if the include condition is false, so it does scan the .pri no 
> matter what but doesn’t really include them to be used only for 
> display!?! So I got all the optional part display but not really used. 
> The compile seem to work. This leave an horrible UX view for developer 
> to see part that aren’t used but source is display and searchable for the project!

Are you talking about qmake or about Qt Creator's .pro file parsing?

Qt Creator evaluates all conditions, including false ones, so it can gather all dependencies and all possibilities. For example, if you had:

contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, i18n): \
    SOURCES += $$AMOTUS_Qt_PATH/i18n.cpp
else: \
    SOURCES += $$AMOTUS_Qt_PATH/no-i18n.cpp

Then Qt Creator should display both files in your file listing. You *want* that.

But qmake will follow only one code path when generating your Makefile.

So please be precise: are you talking about Qt Creator or are you talking about the actual build?
--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products



_______________________________________________
Interest mailing list
Interest at qt-project.org
https://lists.qt-project.org/listinfo/interest


More information about the Interest mailing list