Qt Run Configurations
In Qt Creator->Projects tab, I have multiple build environments and each one generates a different executable name.
I have added a Custom Executable run configuration for each of the build environments to launch the executable from Qt Creator. This requires specifying the path to the executable. This works ok but when I move the project I have to update the run configuration to match the new path. Is there a way I could make it relocatable as with a default run configuration?
Defaut Run configuration Types generate this (and more) XML in the .pro.user file:
<data>
<variable> RunConfiguration0-type</variable>
<value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
</data>
The problem with this is t开发者_如何学运维here is no way to change the name of the executable
A Custom Executable Run configuration Type generates this(and more) XML in the .pro.user file:
<data>
<variable>RunConfiguration2-type</variable>
<value type="QString">ProjectExplorer.CustomExecutableRunConfiguration</value>
</data>
The problem with this is that I have to specify the path of the executable and If I move the project then I have to update the location of the executable in the projects tab.
- Is there a way to use a variable pointing to the build dir in a .pro.user files?
- Where can I find documentation on .pro.user files?
I don't know your Creator version but I think the variable %{buildDir}
is available since 2.1. I tried it with master snapshot (2.2-to-be) on Windows and it works:
%{buildDir}\debug\myapp.exe
精彩评论