Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to refer to the source directory in qmake?

Tags:

qmake

I added

version.target = version.h
version.commands = bash generate-version.sh

QMAKE_EXTRA_TARGETS += version

PRE_TARGETDEPS += version.h

to the project, but it attempts to run "generate-version.sh" in destination directory:

make: Leaving directory `.../qqq-build-desktop'
make: Entering directory `.../qqq-build-desktop'
Makefile:236: warning: overriding commands for target `version.h'
Makefile:233: warning: ignoring old commands for target `version.h'
bash generate-version.sh
bash: generate-version.sh: No such file or directory
make: Leaving directory `.../qqq-build-desktop'

There is $$DESTDIR, but I don't see $$SRCDIR. How to refer to the project directory in qmake (or how to rewrite this)?

like image 388
Vi. Avatar asked Mar 04 '11 10:03

Vi.


1 Answers

PWD

Specifies the full path leading to the directory containing the current file being parsed. This can be useful to refer to files within the source tree when writing project files to support shadow builds.

like image 116
Timmmm Avatar answered Oct 21 '22 01:10

Timmmm