M
M
Mamol272020-02-26 16:10:18
Qt
Mamol27, 2020-02-26 16:10:18

Is it possible to set global variables in a qt pro file?

There is a project, it has many subprojects, I would like to set all the paths in the main pro file so that the rest of the pro files of the subprojects pick up these paths.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ighor July, 2020-02-26
@Mamol27

If you need to get paths in cpp, then like this:
pro: DEFINES += MYVAR='"\\\"Hello world\\\""'
cpp: qDebug().noquote() << MYVAR;
And if only in pro files of other projects, then you can create a pri file with all variables, and include it via include(...pri) in each pro file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question