Reputation: 1256
Is it possible to have different executable name for debug and release version? The executable should be copied to the same output directory for example
C:\Projects\Hello world\bin
In this particular case I want to output two files:
C:\Projects\Hello world\bin\ Hello world.exe
and
C:\Projects\Hello world\bin\ Hello worldD.exe
Upvotes: 1
Views: 1097
Reputation: 9492
On my C++ Builder XE8 installation, there seems to be a cleaner way to do it, although it can't be set through the IDE. And, as noted elsewhere, debugging still seems to be broken.
From the CodeGear.Cpp.Targets
file on my installed copy, we have:
<!-- Output Directories and Filenames -->
<OutputName Condition="'$(OutputName)'==''">$(MSBuildProjectName)</OutputName>
<FinalOutput Condition="'$(FinalOutput)'==''">$(FinalOutputDir)$(DllPrefix)$(OutputName)$(DllSuffix)$(OutputExt)$(DllVersion)</FinalOutput>
Therefore, it looks as though you can set the OutputName property yourself to change the output filename on a per-configuration basis.
For example, on a simple VCL Forms Application, I was able to set it for the Debug Win32 configuration like this:
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<OutputName>testmyapp</OutputName>
<snip>
Obviously, you'd want to duplicate this line in the appropriate PropertyGroup
elements. If this doesn't make sense, I recommend reading up on how MSBuild property groups and conditions work, since that is what Embarcadero's build system is based on.
If this whole situation bothers you, I suggest voting for the feature request which I have created here: https://quality.embarcadero.com/browse/RSP-13108
Upvotes: 1
Reputation: 597036
You can use a Post-Build event to rename the executable after it has been compiled. Different build configurations can have different events defined.
Upvotes: 1