In Delphi (XE2 through to XE5), how can one programmatically add a target platform to a project?
By "programmatically", I mean through the OpenTools API, as opposed to a transform of the .dproj file. This is to be done inside an IDE Wizard/Expert.
I've looked at the ToolsAPI unit, and it appears you can get the active platform, and the list of supported platforms, but there is nothing obvious for adding a new target platform.
It seems that this is possible. The unit you need to look in is
PlatformAPI
. The interface that has what you need is:The
AddPlatform
method appears to be your guy.Note that I've not attempted to call the method. In fact all I did was search for the word platform in the tools API source folder.