Delphi 2007 Output Directory

Abstract: Output directory in Project Options not respected

    Problem Description

I have set an alternative output directory for my project but when I build the project, the executable is written to my source directory

    Problem Resolution

The problem could be due to an environment variable called PLATFORM. If you open the .dproj file you can see where the output path is set:

</Configuration>

<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>

<DCC_DependencyCheckOutputName>d:\output\mytestoproject.exe

You can see that this is conditional on PLATFORM being set to AnyCPU. If you have PLATFORM set to anything other than AnyCPU the condition will not be met and the Output path will not be set.

You can override environment variables in the IDE via the following steps:

  1. Choose Tools | Options.
  2. In the resulting dialog box, select Environment Variables node in the tree.
  3. Locate PLATFORM.
  4. Click on the Add Override… button.
  5. In the Variable Value field, type AnyCPU.
  6. Click OK in both dialogs and restart the IDE.

The output path will now be respected.