Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Variables that persist across .pro files from a subdirs pro file

Greetings,

I've got a .pro file that looks like:

TEMPLATE = subdirs
SUBDIRS = foo bar

I want to set a variable, or define, or something in my subdirs .pro file that can be read in both the foo and bar .pro files.

I've tried to set an environment variable with:

export TEST=something

but that does not work, message($$(TEST)) always shows nothing (like TEST is unset).

like image 837
Dan O Avatar asked Sep 20 '09 09:09

Dan O


1 Answers

Just place them in a common .pri file eg. common.pri and use qmake's own include syntax to include it i.e.

include(path/common.pri)

where path is the path to common.pri relative to the including .pro file.

like image 89
Troubadour Avatar answered Oct 12 '22 14:10

Troubadour