[Insight-developers] ITKv4 Module Names

Brad King brad.king at kitware.com
Thu Feb 10 13:28:20 EST 2011


On 02/10/2011 10:59 AM, Matthew McCormick (thewtex) wrote:
> Are there plans to change the directory layout *inside* the modules too?

The current layout inside each module is

  CMakeLists.txt
  itk-module.cmake
  include/
  src/
  test/

Each one is designed to be able to build as a standalone project.  The
top-level CMakeLists.txt file looks like this:

  cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
  project(itk-statistics)
  find_package(itk-base 4.0 EXACT REQUIRED)
  set(itk-statistics_LIBRARIES itk-statistics)
  itk_module_impl()

Most of the logic is in itk_module_impl() which assumes the standard
layout and avoids code duplication.  In order to handle third-party
code we put their entire source trees under "src/" or "src/foo/".

Under the src/ part the layout can be arbitrary.  If the include/
and test/ part is missing then itk_module_impl() simply ignores
them (and similarly for missing src/ in the header-only case).
We could use Git subtree merges to bring in third-party code under
src/ without trouble.

-Brad


More information about the Insight-developers mailing list