The Opticks SDK provides a few files to help you set up a plug-in build environment.
The Dependencies directory contains a utility to automatically download Opticks dependencies. See the README.windows and README.solaris files for information on using this utility.
Plug-ins are distributed in dynamic modules (.dll files on Windows and .so files on Solaris) which can contain multiple plug-ins. In addition to plug-in source files, each module requires a ModuleManager.cpp file which acts as a factory for the plug-ins in the module. Below is the ModuleManager.cpp file for the tutorial.
/* * The information in this file is * Copyright(c) 2007 Ball Aerospace & Technologies Corporation * and is subject to the terms and conditions of the * GNU Lesser General Public License Version 2.1 * The license text is available from * http://www.gnu.org/licenses/lgpl.html */ #include "PlugInRegistration.h" REGISTER_MODULE(OpticksTutorial);
You should remove most property overrides in the project files. See the example project files for more details. A common way to create a new project file is to copy an existing one. If you do this, there are a few things in the project file which need to be edited with a text editor before adding it to a Visual Studio solution. As an example, I'll copy the tutorial project file to MyModule.vcxproj. I open the new project file in a text editor such as notepad.exe and change the following lines.
<ProjectGuid>{93926B8A-738B-4DEB-9045-AE7C0BB4ABD4}</ProjectGuid>
<RootNamespace>Tutorial</RootNamespace>
<TypeLibraryName>.\Debug/Tutorial.tlb</TypeLibraryName>
<ClCompile Include="ModuleManager.cpp" /> <ClCompile Include="Tutorial1.cpp" /> <ClCompile Include="Tutorial2.cpp" /> <ClCompile Include="Tutorial3.cpp" /> <ClCompile Include="Tutorial4.cpp" /> <ClCompile Include="Tutorial5.cpp" /> </ItemGroup> <ItemGroup> <ClInclude Include="Tutorial1.h" />
Once you've made these changes, save the project file and add it to a Visual Studio solution. Make changes to the list of property sheets in the Property Manager inside Visual Studio. Add files for your module including a ModuleManager.cpp and build your plug-ins.
There are a few environment variables which are required for this build system to function.
The scons equivalent of property sheets are the .py files in the Application/CompileSettings directory. If your plug-in requires a library not included in the default set such as libtiff, you can edit the SConscript file that is created in your module's directory. This shows how to include the libtiff tool.
Import('env build_dir')
Import('env build_dir TOOLPATH')
env = env.Clone()
env.Tool("libtiff",toolpath=[TOOLPATH])
This scons build system uses the same environment variables as the Visual Studio build system.