I\'m working on a cross-platform Qt application and the paths are different on Mac OS X and Windows. Since the project is on an external hard-drive, the drive letter also occasi
The built-in _PRO_FILE_PWD_ variable contains the path to the directory containing the project file in use. That variable may be useful for you.
Since I struggled a bit to find it, I'm adding it here.
In addition to %{sourceDir}
and %{buildDir}
, you could use %{CurrentDocument:Path}
, %{CurrentDocument:FilePath}
and %{CurrentProject:Path}
to refer to specific files and folders in the project directory.
To complete, @Bill's answer, the way to refer to the source path in the Build Settings is to use %{sourceDir}
.
%{buildDir}
is also available.
There are problems with $$_PRO_FILE_PWD_ on windows, because it contains forward slash allways. You need to fix slash using shell_path.
$$shell_path($$_PRO_FILE_PWD_)