Question

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])
Was it helpful?

Solution

  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.

OTHER TIPS

QT_INSTALL_PLUGINS is a persistent property of qmake. You can print its value on the command line using

qmake -query QT_INSTALL_PLUGINS

To change this location, use qmake -set <property> <value>. Type qmake -help for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top