[Interest] Help a unix guy on windows qmake

Jérôme Godbout godboutj at amotus.ca
Wed Apr 21 21:36:49 CEST 2021

For my .pri and qmake build process (I haven’t move to cmake yet) I do some variable definition for the path:
AMOTUS_Qt_FILESYSTEM_PATH = $$clean_path($$PWD/../FileSystem)

So you could define a variable anywhere you are (relative to the .pro or .pri files). Might help finding your project root or define it.

This allows me to have a variable that point to some module folder later on. I can copy, include, etc files/folders based on those variables, also make conditional check if the variable is defined to include glue between module (extension modules with each other).

Something like:
contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, Amotus_Qt_FileSystem){

From: Interest <interest-bounces at qt-project.org> on behalf of Jason H <jhihn at gmx.com>
Date: Wednesday, April 21, 2021 at 1:42 PM
To: Thiago Macieira <thiago.macieira at intel.com>
Cc: interest at qt-project.org <interest at qt-project.org>
Subject: Re: [Interest] Help a unix guy on windows qmake

> Sent: Wednesday, April 21, 2021 at 1:14 PM
> From: "Thiago Macieira" <thiago.macieira at intel.com>
> To: interest at qt-project.org
> Subject: Re: [Interest] Help a unix guy on windows qmake
> On Wednesday, 21 April 2021 09:54:09 PDT Jason H wrote:
> > Now, when compiling, regardless of shadow build or not, refer to the libs by
> > adding to the project: +++ project.pro
> > + mingw {
> > +     INCLUDEPATH += $PROJ/libraries/win/include
> > +     LIBS += -L$PROJ/libraries/win/$ARCH -lvendor
> > + }
> >
> > It seems that $PWD ${PWD} or whatever ($${PWD}?) refer to the build dir, be
> > it shadow or not. I don't want to copy the libraries to the shadow dir in
> > QMAKE_PRE_LINK because they *never* change.
> You're mixing environment variables and qmake variables. Qmake variables
> always start with a double dollar sign and are expanded by qmake when it
> writes the Makefile output. You can see their value with message().
> qmake does not expand environment variables at all.
> $ X=A qmake Y=b /dev/stdin -o /dev/null <<<'message(r = $X $$Y)'
> Project MESSAGE: r = $X b
> The environment variables are written as-is to your Makefile. It's up to you
> to write something that make will understand.
> $PROJ is not a valid environment variable expansion in Make.

Right. I used $PROJ for illustrative purposes. I guess the flaw in my thinking
is that when the shadow build is made, that there is some way to reference the
original location( other than ../project_name

Maybe all I need is:

Thank you for example. Very enlightening.
Interest mailing list
Interest at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210421/b86ccf3b/attachment.html>

More information about the Interest mailing list