ITK/Release 4/Modularization/Add new classes: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
It is helpful to understand the structure of a module before adding a class to it,
= Adding a New Class to a Module =
please read [http://www.itk.org/Wiki/ITK_Release_4/Modularization/_Add_a_module  Add a module] first.


It is necessary to understand the structure of a module before adding a class to it,


*  Which module it belongs to?
Please read first:
  The module grouping is listed in ITK/CMake/ITKGroup.cmake.
 
* [http://www.itk.org/Wiki/ITK_Release_4/Modularization/_Add_a_module Add a module]
 
Then continue with the following process
 
== Where to put it ==
 
Which module it belongs to?
 
The module grouping is listed in
 
  ITK/CMake/ITKGroup.cmake.  
   
   
Does the new class brings in new dependency to this module?
 
  If yes, then you need to edit the module's dependency list in itk-module.cmake.
== Dependencies ==
 
Does the new class brings in new dependency to this module?
 
If yes, then you need to edit the module's dependency list in the file
 
        itk-module.cmake
 
that you will find in the top directory of every module.
 
 
'''One should avoid adding module dependencies without consulting the developer's list'''
    
    
*  Put code in the right directory
  If it is a template class, put the header and the template files into "include" directory.
  If it is a library source class, put the cxx file into "src" directory, and the corresponding header into "include" directory. Also need to edit the src/CMakeLists.txt accordingly.


* Add unit tests
== The Code ==
  Edit the test/CMakeList.txt according to the notes in [http://www.itk.org/Wiki/ITK_Release_4/Modularization/_Add_tests  Add tests]
 
Put code in the right directory
 
# If it is a template class, put the header and the template files into "include" directory.
# If it is a library source class, put the cxx file into "src" directory, and the corresponding header into "include" directory.
#* Also need to edit the src/CMakeLists.txt accordingly.
 
 
== Add unit tests ==
 
Edit the file
 
  test/CMakeList.txt  
 
according to the notes in  
 
* [http://www.itk.org/Wiki/ITK_Release_4/Modularization/_Add_tests  Add tests]

Latest revision as of 16:00, 9 December 2011

Adding a New Class to a Module

It is necessary to understand the structure of a module before adding a class to it,

Please read first:

Then continue with the following process

Where to put it

Which module it belongs to?

The module grouping is listed in

  ITK/CMake/ITKGroup.cmake. 

Dependencies

Does the new class brings in new dependency to this module?

If yes, then you need to edit the module's dependency list in the file

        itk-module.cmake

that you will find in the top directory of every module.


One should avoid adding module dependencies without consulting the developer's list


The Code

Put code in the right directory

  1. If it is a template class, put the header and the template files into "include" directory.
  2. If it is a library source class, put the cxx file into "src" directory, and the corresponding header into "include" directory.
    • Also need to edit the src/CMakeLists.txt accordingly.


Add unit tests

Edit the file

  test/CMakeList.txt 

according to the notes in