Skip to content

Commit

Permalink
ENH: Make buildable as an ITKModule.
Browse files Browse the repository at this point in the history
For now, only the examples can be built, not the documentation.

Rename the top level "Modules" directory to "src".

Change-Id: I57f31965b2514b38dfc3c62719fdda7624780909
  • Loading branch information
thewtex committed Jul 26, 2013
1 parent 59a5665 commit 62b6cc3
Show file tree
Hide file tree
Showing 387 changed files with 31 additions and 17 deletions.
19 changes: 11 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set( _RootSubDirs
CMake
Formatting
Utilities
Modules
src
Documentation
Superbuild
)
Expand Down Expand Up @@ -83,7 +83,7 @@ if( BUILD_DOCUMENTATION )
# We must also duplicate the source tree since the images need to be present
# with the source.
add_custom_target( copy_sources ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ITKExamples_SOURCE_DIR}/Modules" "${ITKExamples_BINARY_DIR}/Modules"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ITKExamples_SOURCE_DIR}/src" "${ITKExamples_BINARY_DIR}/src"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ITKExamples_SOURCE_DIR}/Documentation" "${ITKExamples_BINARY_DIR}/Documentation"
COMMAND ${CMAKE_COMMAND} -E copy "${ITKExamples_SOURCE_DIR}/index.rst" "${ITKExamples_BINARY_DIR}/index.rst"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${ITKExamples_SOURCE_DIR}/Formatting"
Expand Down Expand Up @@ -216,10 +216,13 @@ endif()

# Build the example executables?
option( BUILD_EXECUTABLES "Build the example executables." ON )
if( BUILD_EXECUTABLES )
add_subdirectory( Modules )
endif()

add_subdirectory( Utilities )
if( COMMAND itk_module_impl )
itk_module_impl()
else()
if( BUILD_EXECUTABLES )
add_subdirectory( src )
endif()
add_subdirectory( Utilities )

include( CPack )
include( CPack )
endif()
2 changes: 1 addition & 1 deletion Documentation/Contribute/ContributeWithGit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ binary tree (/path/to/ITKExamples-build/Utilities)::
Note that the generated files are then located based on the group, module and
class name to be demonstrated. For instance an example which would demonstrate
the usage of :itkdox:`itk::Image` will be generated in
``Modules/Core/Common/``.
``src/Core/Common/``.

Please do not add images directly to the repository. Instead, use the
:ref:`content link system <upload-binary-data>`.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Contribute/UploadBinaryData.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ After joining the `ITK Midas Community`_ as instructed above, migrate to the
Community`_. Select a *<GroupName>* and *<ModuleName>* corresponding
to the location within the ITK source tree of the primary class demonstrated by your
example. The ITK source tree is organized into a
*Modules/<GroupName>/<ModuleName>* structure.
*src/<GroupName>/<ModuleName>* structure.

.. figure:: MigrateToFolder.png
:alt: Migrate to corresponding group and module folder
Expand Down
4 changes: 2 additions & 2 deletions Documentation/Contribute/WriteANewExample.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ The characters used to define reStructuredText_ sections are as follows::
Directory placement
-------------------

The examples live inside the *Modules* directory of the repository. They
The examples live inside the *src* directory of the repository. They
are organized by the dominant class demonstrated in the example. There
are two directories of organization which mirror the directory layout in ITKv4,
*Group* followed by *Module*. Therefore, place the example in the directory
corresponding to the Module of one of the prominant classes used in the example.

For instance, an examples that demonstrates the *BinaryDilateImageFilter* would
be placed in the *Modules/Filtering/BinaryMathematicalMorphology/*
be placed in the *src/Filtering/BinaryMathematicalMorphology/*
directory.


Expand Down
2 changes: 1 addition & 1 deletion Formatting/templates/indexcontent.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1>Welcome to the Insight Toolkit Examples!</h1>
<table class="contentstable" align="center" style="margin-left: 30px">
<tr>
<td class="contentstable" width="50%">
<p class="biglink"><a class="biglink" href="{{ pathto("Modules/index") }}">Learn</a><br/>
<p class="biglink"><a class="biglink" href="{{ pathto("src/index") }}">Learn</a><br/>
<span class="linkdescr">the extensive library of ITK examples</span></p>
</td>
<td class="contentstable" width="50%">
Expand Down
4 changes: 2 additions & 2 deletions Utilities/ArchiveBinaryData.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ def run(itk_source_dir, externaldata_object_store,
md5files.append(os.path.join(root, filename))

for content_link in md5files:
if content_link.find('Modules') == -1:
if content_link.find('src') == -1:
uncategorized = True
else:
uncategorized = False

if uncategorized:
folders = ['Uncategorized']
else:
group_module_path = content_link.split('Modules')[1][1:]
group_module_path = content_link.split('src')[1][1:]
hiercharchy = group_module_path.split(os.path.sep)
group = hiercharchy[0]
module = hiercharchy[1]
Expand Down
2 changes: 1 addition & 1 deletion Utilities/CreateTarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
cwd = os.getcwd()
example_name = sys.argv[1]
example_dir = os.path.join(cwd, example_name)
example_idx = example_dir.index('/Modules/') + 1
example_idx = example_dir.index('/src/') + 1
html_output_dir = os.path.join(sys.argv[2], 'html', example_dir[example_idx:])

if not os.path.exists( html_output_dir ):
Expand Down
2 changes: 1 addition & 1 deletion index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Contents:

Documentation/Build/index
Documentation/Contribute/index
Modules/index
src/index
Documentation/Download/index
Documentation/Credits

Expand Down
8 changes: 8 additions & 0 deletions itk-module.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set( DOCUMENTATION "This module builds all the examples found at http://itk.org/ITKExamples" )

itk_module(ITKExamples
DEPENDS
ITKCommon
DESCRIPTION
"${DOCUMENTATION}"
)
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions Modules/CMakeLists.txt → src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
if( itk-module )
set( ITK_DIR ${ITK_BINARY_DIR} )
endif()
find_package( ITK REQUIRED )
include( ${ITK_USE_FILE} )

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 62b6cc3

Please sign in to comment.