Difference between revisions of "Documentation/Snapshot/Developers/Tutorials/ExtensionWriting"

From Slicer Wiki
Jump to: navigation, search
m (Created page with '= Introduction = An extension should be considered as a collection of modules. * How to create plug-ins for Slicer 4 = Additional…')
 
 
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
* [[media:AHM-2011-SlicerExtensions-final.ppt|How to create plug-ins for Slicer 4]]
 
* [[media:AHM-2011-SlicerExtensions-final.ppt|How to create plug-ins for Slicer 4]]
  
= Additional C/CXX flags ==
+
== Metadata ==
  
<code>
+
== Extension dependencies ==
 +
 
 +
<pre>
 +
set(EXTENSION_DEPENDS NA) # Specified as a space separated list or 'NA' if any
 +
</pre>
 +
 
 +
== Additional C/CXX flags ==
 +
 
 +
<pre>
 
find_package(Slicer REQUIRED)
 
find_package(Slicer REQUIRED)
  
Line 15: Line 23:
  
 
include(${Slicer_USE_FILE})
 
include(${Slicer_USE_FILE})
</code>
+
</pre>
 +
 
 +
== License & Readme ==
 +
 
 +
<pre>
 +
set(EXTENSION_LICENSE_FILE ${Slicer_LICENSE_FILE})
 +
set(EXTENSION_README_FILE ${Slicer_README_FILE})
 +
set(EXTENSION_LICENSE_SHORT_DESCRIPTION ${Slicer_LICENSE_SHORT_DESCRIPTION})
 +
</pre>
  
 +
== Superbuild extension  - Package external project ==
 +
<pre>
 +
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/")
 +
#set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${<EP>_DIR};<EP>;RuntimeLibraries;/")
 +
INCLUDE(${Slicer_EXTENSION_CPACK})
 +
</pre>
  
 
= Editor Extensions =
 
= Editor Extensions =
 
*[[Documentation/4.0/EditorExtension|Step-by-step instructions for an Editor Extension]]
 
*[[Documentation/4.0/EditorExtension|Step-by-step instructions for an Editor Extension]]

Latest revision as of 17:43, 10 April 2012

Home < Documentation < Snapshot < Developers < Tutorials < ExtensionWriting

Introduction

An extension should be considered as a collection of modules.

Metadata

Extension dependencies

set(EXTENSION_DEPENDS NA) # Specified as a space separated list or 'NA' if any

Additional C/CXX flags

find_package(Slicer REQUIRED)

# Additional C/CXX flags - Should be defined before including Slicer_USE_FILE
set(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional ${EXTENSION_NAME} C Flags")
set(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional ${EXTENSION_NAME} CXX Flags")

include(${Slicer_USE_FILE})

License & Readme

set(EXTENSION_LICENSE_FILE ${Slicer_LICENSE_FILE})
set(EXTENSION_README_FILE ${Slicer_README_FILE})
set(EXTENSION_LICENSE_SHORT_DESCRIPTION ${Slicer_LICENSE_SHORT_DESCRIPTION})

Superbuild extension - Package external project

set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/")
#set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${<EP>_DIR};<EP>;RuntimeLibraries;/")
INCLUDE(${Slicer_EXTENSION_CPACK})

Editor Extensions