The IDE uses Microsoft's MSBuild engine to build a project. You can build projects without knowing anything about MSBuild; the IDE handles all the details for you. However, you can also directly build the project using MSBuild command-line syntax as described here. When you build a project, the results of the build appear in the Output pane of the Messages window. If you have entered build events, the build output pane displays the commands you specified and their results.
MSBuild command-line syntax has the form:
MSBuild <projectname> [/t:<target name>][/p:config=<configuration_name>]
To build a project using the command line
- From the Start menu, select CodeGear RAD StudioRAD Studio Command Prompt. The command prompt window automatically sets the environment for using RAD Studio tools such as MSBuild.exe.
- Navigate to the directory that contains your project, such as C:\Documents and Settings\<myname>\My Documents\RAD Studio\Projects.
- Type msbuild but do not press Return yet.
- Enter your project name, such as TelePoll.dproj (a Delphi project) or UserInfo.cbproj (a C++ project). If the project is not in the current directory, you must include the full path name to the project directory.
- To specify a target, enter the /t: tag followed by one of the targets specified in your project file. The three standard target names are clean, make, and build:
- Clean means to clean the project, removing generated files such as object code. Clean corresponds to the Project Manager context menu item Clean.
- Make means to compile the project. Make corresponds to the context menu item Compile.
- Build means to build the project. Build corresponds to the context menu item Build. The three targets are similar to the Clean, Compile, and Build commands on the context menu in the Project Manager. The default target is build.
- To specify a configuration, enter the configuration name after /p:config =. If you do not specify a configuration, MSBuild uses the current active configuration. To specify a configuration, use the name of one of the existing build configurations in your project. This can be either a default configuration, such as Debug, or a configuration you have added to the project. If the configuration name has a space in it, enter the name bounded by double quotes, such as: /p:config =“My config”
- Enter any other options and press Return to begin the build.
To display online help for MSBuild (including a full example command line), open the RAD Studio Command Prompt (see Step 1) and enter
MSBuild /help.
For more information about MSBuild, see the Microsoft documentation at http:\\msdn.microsoft.com.