Hi folks,

I have a big project with this structure :

Qt Code:
  1. MainDir
  2. +--src
  3. +--Launcher
  4. +--CoreLibrary
  5. +--plugins
  6. +--Plugin 1
  7. +--...
  8. +--Plugin N
To copy to clipboard, switch view to plain text mode 

Into MainDir I have a prf file with global configurations I don't want to repeat on every .pro file ( DESTDIR, debug/release options, don't care about it... )

All the structure is managed through *.pro / *.pri file. Until now I have defined a MAINDIR variable to use in all *.pri files, but I want to auto-define it. It's possible, I've done it in my MainDir.pro file.

It looks like this :

Qt Code:
  1. # Global variables, MAIN DIR
  2. MAINDIR=$$IN_PWD
  3. QMAKEFEATURES=$$IN_PWD
  4.  
  5. message($$MAINDIR)
  6. message($$QMAKEFEATURES)
  7.  
  8. TEMPLATE = subdirs
  9. SUBDIRS = src
To copy to clipboard, switch view to plain text mode 

When I run qmake, it shows the correct path, but ONLY for the first level of .pro, when passing to src subdir, the variable is undefined.

Anyone knows how to export variables in subdir templates ? I've been googling around an found nothing...