[Insight-developers] Improving module CMake help text

Brad King brad.king at kitware.com
Mon Dec 5 10:22:26 EST 2011


On 12/5/2011 10:09 AM, David Doria wrote:
> I suggest we use it to come to a consensus on the text. Currently the
> root CMakeLists.txt generates the generic help text for each module.
> Would it be possible to add a variable to each module's CMakeLists.txt
> called HELP_TEXT that could be referenced from the root
> CMakeLists.txt? Storing the text inside the module will ensure things
> stay in sync down the road.

The itk-module.cmake files already have a DESCRIPTION field:

  http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/Core/Common/itk-module.cmake;hb=v4.0rc03

Try the patch below (untested).

-Brad


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72e4a77..eb452d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -338,7 +338,7 @@ include(${ITK_SOURCE_DIR}/CMake/ITKGroups.cmake)
  # Provide an option for each module.
  foreach(itk-module ${ITK_MODULES_ALL})
    if(NOT ${itk-module}_IS_TEST)
-    option(Module_${itk-module} "Request building ${itk-module}" OFF)
+    option(Module_${itk-module} "Request building ${itk-module}\n${ITK_MODULE_${itk-module}_DESCRIPTION}" OFF)
      mark_as_advanced(Module_${itk-module})
      if(ITK_MODULE_${itk-module}_EXCLUDE_FROM_ALL)
        set(ITK_MODULE_${itk-module}_IN_ALL 0)


More information about the Insight-developers mailing list