Opticks Developer Guide/Configuring Your Build Environment

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Building an Opticks plug-in is fairly easy. The SDK contains a number of tutorials and sample plug-ins to get you started. When compiling a plug-in you need to add the following directories to your include path.

  • C:\Development\Opticks\4.1.0\application\Interfaces
  • C:\Development\Opticks\4.1.0\application\PlugInUtilities\Interfaces
  • C:\Development\Opticks\4.1.0\application\PlugInLib

The following directories need to be added to your library path.

  • C:\Development\Opticks\4.1.0\Build\Binaries-Win32-Release\lib

This should be changed to the appropriate Binaries-* directory which corresponds to the platform you are targeting.

Link with the following libraries. (these are windows names, use .so for Solaris)

  • PlugInLib.lib
  • PlugInUtilities.lib

Windows requires an export definition file. This is located at C:\Development\Opticks\4.1.0\application\PlugInManager\PlugInModule.def

In addition, you may need to add one or more third party libraries to the include an library paths. These are located in the C:\Development\Opticks\Dependencies directory. Common libraries needed include boost, qt, and xerces.

Compile the plug-in as a .dll (or .so on Solaris) and copy the resulting file to the PlugIns directory in your Opticks install. Note that you must compile your plug-in in release mode on Windows in order to place it in this location. Debug build must use the binaries located in C:\Development\Opticks\4.1.0\Build\Binaries-Win32-Debug.

Restart Opticks and your plug-in should load. The Opticks SDK provides a more complete build system which we suggest you use. It is more resistant to changes in the SDK, allows for location independent development, and eases configuration for of third party libraries. The rest of this chapter talks about the advanced build system.

Visual Studio Environment[edit | edit source]

On Windows, the first thing a new developer must do to properly setup their Visual Studio development environment is to create these three environment variables. The OPTICKS_HOME and OPTICKS_INSTALL point to the location of the OPTICKS release. The OPTICKDEPENDENCIES variable points to the location of the libraries Opticks depends on. To create environment variables right click on the My Computer icon on your Desktop and select properties. From the properties dialog go to the advanced tab and click on the Environment Variables button. Add a new user environment variable by clicking on the new button under the user environment variables section.

OPTICKS_HOME = C:\develop\Opticks\4.1.0
OPTICKSDEPENDENCIES = C:\develop\Dependencies\4.1.0
  • Run the Opticks.exe under the Toolkit\Build\Binaries-"platform"-"config"\Bin directory. "platform" is win32 or x64 and "config is debug or release. When running the Visual Studio debugger select the debug version matching your platform.
  • The first time running Opticks under any platform you must modify the plug-in path setting.
  • Once Opticks starts up, go to the Tools\Options menu, select File Locations, click on the cell next to the plug-in path. Select the browse button that becomes active in the selected cell.
    Change the plug-in path to: Toolkit\Build\Binaries-"platform"-"config"\PlugIns directory where "platform" and "config" match your configuration. Click Ok to accept the change and close the Options dialog. Click OK on the following message. Shutdown Opticks (File\Exit).
  • You should now have a properties file in your C:\Documents and Settings\username\Application Data\Opticks directory matching the configuration.

Forward to Sample Plug-ins