<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JamesCook</id>
	<title>Slicer Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JamesCook"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/wiki/Special:Contributions/JamesCook"/>
	<updated>2026-04-21T09:05:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Module&amp;diff=35601</id>
		<title>Documentation/Nightly/Developers/Build Module</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Module&amp;diff=35601"/>
		<updated>2013-09-11T17:15:45Z</updated>

		<summary type="html">&lt;p&gt;JamesCook: /* Build module outside of Slicer source tree */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
= Build module outside of Slicer source tree =&lt;br /&gt;
&lt;br /&gt;
The different [[Documentation/{{documentation/version}}/Developers/Modules|type of modules]] supported by Slicer can easily be built outside of the Slicer source tree.&lt;br /&gt;
&lt;br /&gt;
The following examples are specific to unix-like platforms and can easily be adapted for Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Assuming the source code of your module is located in folder &amp;lt;code&amp;gt;MyModule&amp;lt;/code&amp;gt;, externally building modules could be achieved doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir MyModule-build&lt;br /&gt;
$ cd MyModule-build&lt;br /&gt;
$ cmake -DSlicer_DIR:PATH=/path/to/Slicer-Superbuild/Slicer-build ../MyModule&lt;br /&gt;
$ make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this to work, in addition to invoke &amp;lt;code&amp;gt;cmake_minimum_required&amp;lt;/code&amp;gt; at the top of the top-level &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;, it's important to make sure the following line are added after setting &amp;lt;code&amp;gt;MODULE_NAME&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find_package(Slicer REQUIRED)&lt;br /&gt;
include(${Slicer_USE_FILE})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.8.9)  &amp;lt;- - - - ADD THIS&lt;br /&gt;
&lt;br /&gt;
find_package(Slicer COMPONENTS ConfigurePrerequisites)  &amp;lt;- - - - ADD THIS&lt;br /&gt;
&lt;br /&gt;
project(EmptyExtensionTemplate) &amp;lt;- - - - ADD THIS&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
set(MODULE_NAME ${PROJECT_NAME})&lt;br /&gt;
set(MODULE_TITLE ${MODULE_NAME})&lt;br /&gt;
&lt;br /&gt;
string(TOUPPER ${MODULE_NAME} MODULE_NAME_UPPER)&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
find_package(Slicer REQUIRED)  &amp;lt;- - - - - - - ADD THIS&lt;br /&gt;
include(${Slicer_USE_FILE})  &amp;lt;- - - - - - - - ADD THIS&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
add_subdirectory(Logic)&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
set(MODULE_EXPORT_DIRECTIVE &amp;quot;Q_SLICER_QTMODULES_${MODULE_NAME_UPPER}_EXPORT&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After successfully compiling the Slicer module, the Slicer module executables and libraries are located in your module build directory under lib &amp;lt;code&amp;gt;build_dir/lib/Slicer-X.Y/module_type&amp;lt;/code&amp;gt;. Adding this directory to the Additional module paths in the Application Settings GUI within slicer, will allow testing of your module without recompiling the super-build.  Refer to [[Documentation/{{documentation/version}}/Developers/DirectoryStructure|Directory Structure]] description for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Documentation/{{documentation/version}}/Developers/FAQ/Modules|Modules}}&lt;/div&gt;</summary>
		<author><name>JamesCook</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Module&amp;diff=35600</id>
		<title>Documentation/Nightly/Developers/Build Module</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Module&amp;diff=35600"/>
		<updated>2013-09-11T17:13:37Z</updated>

		<summary type="html">&lt;p&gt;JamesCook: /* Build module outside of Slicer source tree */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
= Build module outside of Slicer source tree =&lt;br /&gt;
&lt;br /&gt;
The different [[Documentation/{{documentation/version}}/Developers/Modules|type of modules]] supported by Slicer can easily be built outside of the Slicer source tree.&lt;br /&gt;
&lt;br /&gt;
The following examples are specific to unix-like platforms and can easily be adapted for Windows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Assuming the source code of your module is located in folder &amp;lt;code&amp;gt;MyModule&amp;lt;/code&amp;gt;, externally building modules could be achieved doing:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mkdir MyModule-build&lt;br /&gt;
$ cd MyModule-build&lt;br /&gt;
$ cmake -DSlicer_DIR:PATH=/path/to/Slicer-Superbuild/Slicer-build ../MyModule&lt;br /&gt;
$ make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this to work, in addition to invoke &amp;lt;code&amp;gt;cmake_minimum_required&amp;lt;/code&amp;gt; at the top of the top-level &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;, it's important to make sure the following line are added after setting &amp;lt;code&amp;gt;MODULE_NAME&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find_package(Slicer REQUIRED)&lt;br /&gt;
include(${Slicer_USE_FILE})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.8.9)  &amp;lt;- - - - ADD THIS&lt;br /&gt;
&lt;br /&gt;
find_package(Slicer COMPONENTS ConfigurePrerequisites)  &amp;lt;- - - - ADD THIS&lt;br /&gt;
&lt;br /&gt;
project(EmptyExtensionTemplate) &amp;lt;- - - - ADD THIS&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
set(MODULE_NAME ${PROJECT_NAME})&lt;br /&gt;
set(MODULE_TITLE ${MODULE_NAME})&lt;br /&gt;
&lt;br /&gt;
string(TOUPPER ${MODULE_NAME} MODULE_NAME_UPPER)&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
find_package(Slicer REQUIRED)  &amp;lt;- - - - - - - ADD THIS&lt;br /&gt;
include(${Slicer_USE_FILE})  &amp;lt;- - - - - - - - ADD THIS&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
add_subdirectory(Logic)&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
set(MODULE_EXPORT_DIRECTIVE &amp;quot;Q_SLICER_QTMODULES_${MODULE_NAME_UPPER}_EXPORT&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After successfully compiling the Slicer module, the Slicer module executables and libraries are located in your module build directory under lib &amp;lt;code&amp;gt;build_dir/lib/Slicer-X.Y/module_type&amp;lt;/code&amp;gt;. Refer to [[Documentation/{{documentation/version}}/Developers/DirectoryStructure|Directory Structure]] description for more details.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{:Documentation/{{documentation/version}}/Developers/FAQ/Modules|Modules}}&lt;/div&gt;</summary>
		<author><name>JamesCook</name></author>
		
	</entry>
</feed>