Commit defd86d6 authored by jcfr's avatar jcfr

ENH: Extensions can now be built with Slicer proper

Assuming the top-level folder name matches the extension name, it is now
possible to configure Slicer so that it also builds a chosen set of
extension source directories. If a package is generated,
these extensions will also be packaged.

Configuring Slicer passing the option "Slicer_EXTENSION_SOURCE_DIRS" will
achieve the desired goal.

For example, if we want to bundle within Slicer extensions "MinimalistiCli" and "SkullStripper",
the following could be done:

 cmake -DSlicer_EXTENSION_SOURCE_DIRS:STRING=/home/jchris/Projects/MinimalistiCli\;/home/jchris/Projects/SkullStripper .

The associated build tree will then be located in:
  /path/to/Slicer-Superbuild-Release/Slicer-build/Extensions/MinimalistiCli and
/path/to/Slicer-Superbuild-Release/Slicer-build/Extensions/SkullStripper

See http://na-mic.org/Mantis/view.php?id=2293

Fixes #2293

git-svn-id: http://svn.slicer.org/Slicer4/trunk@20576 3bd1e089-480b-0410-8dfb-8563597acbee
parent 78fc3771
......@@ -814,6 +814,24 @@ set(Slicer_GUI_LIBRARY qSlicerBaseQTGUI)
add_subdirectory(Modules)
add_subdirectory(Applications)
# --------------------------------------------------------------------------
# Bundle extension(s)
# --------------------------------------------------------------------------
# List of extension source directories can be passed at configuration time
# using the following syntax:
# cmake -DSlicer_EXTENSION_SOURCE_DIRS:STRING=/path/to/ExtensionA;/path/to/ExtensionB /path/to/source/Slicer
foreach(extension_source_dir ${Slicer_EXTENSION_SOURCE_DIRS})
get_filename_component(extension_source_dirname ${extension_source_dir} NAME_WE)
message(STATUS "Configuring extension: ${extension_source_dirname}")
set(ExternalData_SOURCE_ROOT ${extension_source_dir})
set(${extension_source_dirname}_SOURCE_DIR ${extension_source_dir})
set(${extension_source_dirname}_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Extensions/${extension_source_dirname})
add_subdirectory(
${${extension_source_dirname}_SOURCE_DIR}
${${extension_source_dirname}_BINARY_DIR}
)
endforeach()
# --------------------------------------------------------------------------
# Recover the QM output directories
# --------------------------------------------------------------------------
......
......@@ -330,6 +330,7 @@ ExternalProject_Add(${proj}
-DSlicer_SUPERBUILD:BOOL=OFF
-DSlicer_SUPERBUILD_DIR:PATH=${Slicer_BINARY_DIR}
-DSlicer_BUILD_WIN32_CONSOLE:BOOL=${Slicer_BUILD_WIN32_CONSOLE}
-DSlicer_EXTENSION_SOURCE_DIRS:STRING=${Slicer_EXTENSION_SOURCE_DIRS}
-DSlicer_FORCED_WC_REVISION:STRING=${Slicer_FORCED_WC_REVISION}
-DDOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY:PATH=${DOCUMENTATION_ARCHIVES_OUTPUT_DIRECTORY}
-DDOXYGEN_EXECUTABLE:FILEPATH=${DOXYGEN_EXECUTABLE}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment