[ITK] [ITK-users] How to compile a new module inside the ITK build tree?

Matt McCormick matt.mccormick at kitware.com
Fri Feb 13 15:37:48 EST 2015


Hi,

While it is true that a module can't be built out of ITK (there are
some features from VTK modularization that could be ported here), it
is possible to build just a module and its dependencies.

Clone or symlink the module repository in the

  Modules/External directory.

Enable the module in your CMake configuration -- it should be a
boolean variable name Module_<mymodulename>.  This will build the
given module and all its dependencies.  To not build all the other
modules, turn BUILD_DEFAULT_MODULES to OFF.

There are some more tips on module enablement in the ITK Software Guide.

HTH,
Matt


On Fri, Feb 13, 2015 at 7:34 AM, Bradley Lowekamp
<blowekamp at mail.nih.gov> wrote:
> Hello Davis,
>
> 1. Currently you must build a module inside of ITK, it can't be build separately. This is a feature on my wish list too. However, most of the ITK modules I have written don't actually have a compiled library. So use the module in other projects I have added the ITK module as a git submodule and just included the include directory. While this doesn't build testing it does work OK for using the classes from the ITK module in another project.
> 2.  I assume you are using make. Type running "make help"; this will list all the target in the make file. There should be one call "YourModule-all" this will build the module and tests.
>
> Brad
>
> On Feb 13, 2015, at 7:14 AM, DVigneault <davis.vigneault at gmail.com> wrote:
>
>> All--
>>
>> Two related questions concerning development of an external module.
>>
>> 1.  How can I compile a single (external) module, rather than all of ITK?
>> The module template for insight submission [1] states "[n]ow you could
>> compile the new module inside your ITK build tree," which suggests to me
>> that this is possible, but I'm not sure how to go about it.
>> 2.  It is possible to build tests for one module only?  The closest thread I
>> was able to find [2] is useful for running individual tests after they are
>> built, and the wiki page on Modularization [3] didn't specifically discuss
>> testing.
>>
>> Thanks in advance,
>>
>> --Davis
>>
>> [1]
>> https://github.com/InsightSoftwareConsortium/InsightJournalTemplate/tree/ModularTemplate/Source
>> [2] http://itk-users.7.n7.nabble.com/run-test-manually-td32868.html
>> [3]
>> http://www.itk.org/Wiki/ITK/Release_4/Modularization/Configure_and_build_ITK
>>
>>
>>
>> --
>> View this message in context: http://itk-users.7.n7.nabble.com/How-to-compile-a-new-module-inside-the-ITK-build-tree-tp35242.html
>> Sent from the ITK - Users mailing list archive at Nabble.com.
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.php
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/insight-users
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list