<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.10%2FDevelopers%2FTutorials%2FMigrationGuide%2FSlicerExtension</id>
	<title>Documentation/4.10/Developers/Tutorials/MigrationGuide/SlicerExtension - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.10%2FDevelopers%2FTutorials%2FMigrationGuide%2FSlicerExtension"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/Tutorials/MigrationGuide/SlicerExtension&amp;action=history"/>
	<updated>2026-04-21T11:02:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/Tutorials/MigrationGuide/SlicerExtension&amp;diff=59809&amp;oldid=prev</id>
		<title>UpdateBot: Nightly -&gt; 4.10</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/Tutorials/MigrationGuide/SlicerExtension&amp;diff=59809&amp;oldid=prev"/>
		<updated>2018-10-19T00:43:54Z</updated>

		<summary type="html">&lt;p&gt;Nightly -&amp;gt; 4.10&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;__TOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
==Slicer Extension updates==&lt;br /&gt;
===Slicer 4.9: Explicit initialization of CMAKE_BUILD_TYPE not needed anymore===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26978 r26978], calling &amp;lt;tt&amp;gt;find_package(Slicer REQUIRED)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;include(${Slicer_USE_FILE})&amp;lt;/tt&amp;gt; initializes &amp;lt;tt&amp;gt;CMAKE_BUILD_TYPE&amp;lt;/tt&amp;gt; and ensures the variables &amp;lt;tt&amp;gt;CMAKE_BUILD_TYPE&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CMAKE_CONFIGURATION_TYPES&amp;lt;/tt&amp;gt; are passed to all external projects when configuring SuperBuild based extension.&lt;br /&gt;
&lt;br /&gt;
The module &amp;lt;tt&amp;gt;SlicerInitializeBuildType&amp;lt;/tt&amp;gt; is automatically included in &amp;lt;tt&amp;gt;UserSlicer&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Subversion not required anymore===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=27060 r27060], Subversion is not required anymore.&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Support EP_GIT_PROTOCOL and use of ExternalProject_SetIfNotDefined for setting GIT_REPOSITORY, GIT_TAG and alike===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26957 r26957], extension may use the following convention to define &amp;lt;tt&amp;gt;GIT_REPOSITORY&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;GIT_TAG&amp;lt;/tt&amp;gt;, this allows developer to override the value before the first configuration by setting the corresponding environment variable, or by explicitly configuring the project with that variable.&lt;br /&gt;
&lt;br /&gt;
The option &amp;lt;tt&amp;gt;EP_GIT_PROTOCOL&amp;lt;/tt&amp;gt; is also already set in &amp;lt;tt&amp;gt;ExternalProjectDependency&amp;lt;/tt&amp;gt; module included by Slicer and its value is updated based on the &amp;lt;tt&amp;gt;&amp;amp;lt;SUPERBUILD_TOPLEVEL_PROJECT&amp;amp;gt;_USE_GIT_PROTOCOL&amp;lt;/tt&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  ExternalProject_SetIfNotDefined(&lt;br /&gt;
    ${CMAKE_PROJECT_NAME}_${proj}_GIT_REPOSITORY&lt;br /&gt;
    &amp;quot;${EP_GIT_PROTOCOL}://github.com/jcfr/shape4D.git&amp;quot;&lt;br /&gt;
    QUIET&lt;br /&gt;
    )&lt;br /&gt;
&lt;br /&gt;
  ExternalProject_SetIfNotDefined(&lt;br /&gt;
    ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG&lt;br /&gt;
    &amp;quot;12fef84ca2a56feffc59d8159bdadd2ce4a4138e&amp;quot; # slicersalt-2018-01-22-c74c766a4c&lt;br /&gt;
    QUIET&lt;br /&gt;
    )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* https://cmake-artichoke.readthedocs.io/en/latest/ExternalProjectDependency.html#variable:EP_GIT_PROTOCOL&lt;br /&gt;
* https://cmake-artichoke.readthedocs.io/en/latest/ExternalProjectDependency.html#function:ExternalProject_SetIfNotDefined&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Use ExternalProject_AlwaysConfigure to force reconfigure of inner project===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26551 r26551], the function &amp;lt;tt&amp;gt;ExternalProject_AlwaysConfigure&amp;lt;/tt&amp;gt; may be used to ensure the inner project is always reconfigured.&lt;br /&gt;
&lt;br /&gt;
Using the `BUILD_ALWAYS` option supported by &amp;lt;tt&amp;gt;ExternalProject_Add&amp;lt;/tt&amp;gt; will not have the intended effect.&lt;br /&gt;
&lt;br /&gt;
See https://cmake-artichoke.readthedocs.io/en/latest/ExternalProjectDependency.html#function:ExternalProject_AlwaysConfigure&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Specifying external projects to install in SuperBuild extension===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=27267 r27267] and [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=27232 r27232], the following should be used to ensure&lt;br /&gt;
the extension can also be bundled into a Slicer custom application. When bundled, the variable &amp;lt;tt&amp;gt;${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS&amp;lt;/tt&amp;gt; is then used to update the application's list of project to install.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
set(EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS)&lt;br /&gt;
#list(APPEND EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS &amp;quot;${Foo_DIR};Foo;RuntimeLibraries;/&amp;quot;)&lt;br /&gt;
set(${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS &amp;quot;${EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS}&amp;quot; CACHE STRING &amp;quot;List of external projects to install&amp;quot; FORCE)&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS &amp;quot;${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/&amp;quot;)&lt;br /&gt;
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS &amp;quot;${${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS}&amp;quot;)&lt;br /&gt;
include(${Slicer_EXTENSION_GENERATE_CONFIG})&lt;br /&gt;
include(${Slicer_EXTENSION_CPACK})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Generating (Extension)Config.cmake===&lt;br /&gt;
&lt;br /&gt;
Initially introduced in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=25944 r25944], and later improved in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=25991 r25991], including &amp;lt;tt&amp;gt;${Slicer_EXTENSION_GENERATE_CONFIG}&amp;lt;/tt&amp;gt; ensure a config is generated and allow an extension to import targets from another extension by using &amp;lt;tt&amp;gt;find_package(ExtensionName REQUIRED)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
include(${Slicer_EXTENSION_GENERATE_CONFIG})&lt;br /&gt;
include(${Slicer_EXTENSION_CPACK})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Initializing &amp;lt;projectName&amp;gt;_BUILD_SLICER_EXTENSION option: Standalone vs Slicer extension build===&lt;br /&gt;
&lt;br /&gt;
The following snippet allows to automatically initialize &amp;lt;tt&amp;gt;&amp;lt;projectName&amp;gt;_BUILD_SLICER_EXTENSION&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;ON&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;Slicer_DIR&amp;lt;/tt&amp;gt; is defined.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
# Standalone vs Slicer extension option&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
# This option should be named after the project name, it corresponds to the&lt;br /&gt;
# option set to ON when the project is build by the Slicer Extension build&lt;br /&gt;
# system.&lt;br /&gt;
&lt;br /&gt;
set(_default OFF)&lt;br /&gt;
set(_reason &amp;quot;${PROJECT_NAME}_BUILD_SLICER_EXTENSION is ON&amp;quot;)&lt;br /&gt;
if(NOT DEFINED ${PROJECT_NAME}_BUILD_SLICER_EXTENSION AND DEFINED Slicer_DIR)&lt;br /&gt;
  set(_default ON)&lt;br /&gt;
  set(_reason &amp;quot;Slicer_DIR is SET&amp;quot;)&lt;br /&gt;
endif()&lt;br /&gt;
&lt;br /&gt;
option(${PROJECT_NAME}_BUILD_SLICER_EXTENSION &amp;quot;Build as a Slicer Extension&amp;quot; ${_default})&lt;br /&gt;
&lt;br /&gt;
set(_msg &amp;quot;Checking if building as a Slicer extension&amp;quot;)&lt;br /&gt;
message(STATUS ${_msg})&lt;br /&gt;
if(${PROJECT_NAME}_BUILD_SLICER_EXTENSION)&lt;br /&gt;
  message(STATUS &amp;quot;${_msg} - yes (${_reason})&amp;quot;)&lt;br /&gt;
else()&lt;br /&gt;
  message(STATUS &amp;quot;${_msg} - no (${PROJECT_NAME}_BUILD_SLICER_EXTENSION is OFF)&amp;quot;)&lt;br /&gt;
endif()&lt;br /&gt;
mark_as_superbuild(${PROJECT_NAME}_BUILD_SLICER_EXTENSION:BOOL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
</feed>