Difference between revisions of "Slicer3:Windows Shared Libraries"

From NAMIC Wiki
Jump to: navigation, search
 
m (Text replacement - "http://www.slicer.org/slicerWiki/index.php/" to "https://www.slicer.org/wiki/")
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
== How to Add a New Windows Shared Library ==
+
<big>'''Note:''' We are migrating this content to the slicer.org domain - <font color="orange">The newer page is [https://www.slicer.org/wiki/Slicer3:Windows_Shared_Libraries here]</font></big>
 
 
For these examples we will assume you want to make a directory '''MyLib''' -- substitute your only lib name in the instructions below.  
 
 
 
Copy the following files from an existing library (say '''SampleLib''') to create:
 
 
 
=== vtkMyLib.h===
 
 
 
Change the #include to use MyLib
 
 
 
This header can be use for other lib-specific defines.
 
 
 
=== vtkMyLibWin32Header.h===
 
 
 
(careful - this file is error prone!)
 
 
 
Change all  SampleLib to be MyLib.
 
Change all VTK_SAMPLELIB_EXPORT to be VTK_MYLIB_EXPORT.
 
Change VTKSampleLib_STATIC to be VTKMyLib_STATIC
 
Change sampleLib_EXPORTS to be myLib_EXPORTS (NOTE: this is the name of the lib, which may not be the name of the project).
 
 
 
=== vtkMyLibConfigure.h.in===
 
 
 
Change VTKSampleLib_STATIC to VTKMyLib_STATIC
 
 
 
=== CMakeLists.txt ===
 
 
 
In the CMakeLists.txt edit the CONFIGURE_FILE to put MyLib in the binary directory for your project.
 
 
 
=== Header Files ===
 
 
 
Include vtkMyLib.h
 
 
 
Add VTK_MYLIB_EXPORT after the keyword 'class' and before your classname.
 
 
 
  class VTK_MYLIB_EXPORT vtkMyObject : public vtkObject
 

Latest revision as of 18:07, 10 July 2017

Home < Slicer3:Windows Shared Libraries

Note: We are migrating this content to the slicer.org domain - The newer page is here