Example Custom Build Routines
The following sections describe different types of custom build routines suitable for use as custom build commands.
A custom build routine can contain any IDL code. The examples here focus on the process of ensuring that all routines necessary to run an application are compiled when a SAVE file is created. Build routines could also create other SAVE files (containing data, perhaps), move files to different locations, or any other operation IDL can perform.
Replicate the Default Behavior
Suppose you have a simple project containing three PRO files named one.pro, two.pro, and three.pro. To replicate the default behavior (when no custom build command is specified), you could create a batch file named build in the project directory and include the following commands:
The Use a custom build command property text box would contain the following:
Build an iTool Application
Creating an application that incorporates iTool functionality requires that you execute the IRESOLVE command, which in turn requires that you use a custom build command. Suppose you have created a custom iTool application, and want to create a build command to build the application automatically.
Create a batch file named build in the project directory. Include the following:
The Use a custom build command property text box would contain the following:
Build Using the Run Command
In many cases, it is not necessary to manually compile every file in your project. If your application defines only procedures (no functions or object methods), or if you have used the idl2 compile option (set using the
COMPILE_OPT routine) in all of your PRO files, you may be able to simply compile the routine that runs your application, then call RESOLVE_ALL to compile all other needed routines. Usually, this controlling routine is also the routine defined as the Run Command for your project.
Suppose you have an application consisting of many PRO files, all of which set
In addition, all functionality in your application is accessible via a single routine that launches the application. (In most cases, this routine would be the Run Command.) In this scenario, compiling the file that contains the Run Command and then calling RESOLVE_ALL will compile all required routines.
Create a batch file named build in the project directory. Include the following:
The Use a custom build command property text box would contain the following: