Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt $$[...] - configuration option that were set when Qt was built

Tags:

qt

qmake

I'm looking at this Qt5 .pro file. It has the following entry:

DESTDIR = $$[QT_INSTALL_PLUGINS]/ms_plugins

I know that this means the compiled module's output (a plugin) should go into the ms_plugins subfolder in the Qt5 plugins install location. I have verified that the plugin does indeed go into that location.

My questions are:

  1. Where is QT_INSTALL_PLUGINS defined?
  2. On a related note, is there a similar variable that holds the location of the build directory. Typically, something like build_Desktop_Qt_5_2_1_clang_64bit-Debug on my Mac.
  3. Any documentation of all available variables?

EDIT: I've found some description of these variables here, although, I still don't see where they're defined.

EDIT2: Mostly for future visitors. The documentation mentions The special $$[...] operator can be used to access various configuration options that were set when Qt was built:. So in order to figure out what QT_INSTALL_PLUGINS is we can put the following in a .pro file:

message(Plugins: $$[QT_INSTALL_PLUGINS])
like image 831
Code Poet Avatar asked Nov 23 '25 08:11

Code Poet


1 Answers

  1. QT_INSTALL_PLUGINS is one of the built-in properties of qmake. The manual of qmake in Qt 4.8 talks about qmake's built-in properties but does not mention QT_INSTALL_PLUGINS specifically. The manual of qmake in Qt 5 shows a much longer list of built-in properties including QT_INSTALL_PLUGINS. If you take a look at the source of qmake you can see that the value of a built-in property is determined by calling QLibraryInfo::location() (source, doc).

  2. The location of the build directory can be found in a variable called OUT_PWD: OUT_PWD specifies the full path leading to the directory where qmake places the generated Makefile.

  3. You can find the documentation of all available variables here.

like image 60
Bill Avatar answered Nov 24 '25 21:11

Bill