Commit 51c746b7 authored by jcfr's avatar jcfr

COMP: Fix windows packaging. Fixes #4131

This commit addresses regression introduced in r24855 (ENH: Add SlicerDMRI
remote module) where the build folder became too long.

This commit introduces the concept of "REMOTE_EXTENSION" allowing to
add source directory to an extension containing multiple modules. Since
the build directory associated with remote extensions is 13 characters
shorter, it should address the windows packaging problem.

Here is an example of path before and after this change:

C:\path\to\Slicer-Release\Slicer-build\Modules\Remote\SlicerDMRI\Modules\Loadable\TractographyDisplay
C:\path\to\Slicer-Release\Slicer-build\E\SlicerDMRI\Modules\Loadable\TractographyDisplay


Notes:

To avoid doing a clean build and ensure incremental build
are successful, developers should update file:

  C:\path\to\Slicer-Release\Slicer-build\CMakeCache.txt

and remove variables of the form

  "... :INTERNAL= ... Modules\Remote\SlicerDMRI ...".

git-svn-id: http://svn.slicer.org/Slicer4/trunk@24888 3bd1e089-480b-0410-8dfb-8563597acbee
parent 51c9e67b
......@@ -999,8 +999,11 @@ set(Slicer_EXTENSION_CPACK ${Slicer_SOURCE_DIR}/CMake/SlicerExtensionCPack.cmake
# --------------------------------------------------------------------------
# Bundle extension(s)
# --------------------------------------------------------------------------
set(extensions_build_dir "${Slicer_BINARY_DIR}/E")
# Configure SlicerConfig for bundled extension(s) or module(s)
set(Slicer_DIR "${Slicer_BINARY_DIR}/Extensions")
set(Slicer_DIR ${extensions_build_dir})
configure_file(
${Slicer_SOURCE_DIR}/CMake/SlicerConfig.cmake.in
${Slicer_DIR}/SlicerConfig.cmake @ONLY)
......@@ -1010,9 +1013,19 @@ message(STATUS "Configuring remote modules")
message(STATUS "--------------------------------------------------")
add_subdirectory(Modules/Remote)
# List of extension source directories can be passed at configuration time
# using the following syntax:
# Add remote extension source directories.
#
# Directories can be set in two ways:
#
# (1) Automatically by specifying the label 'REMOTE_EXTENSION' when
# calling 'Slicer_Remote_Add' from SuperBuild.cmake.
#
# (2) Expicitly by configuring the project using the following syntax:
# cmake -DSlicer_EXTENSION_SOURCE_DIRS:STRING=/path/to/ExtensionA;/path/to/ExtensionB /path/to/source/Slicer
#
foreach(varname ${Slicer_EP_LABEL_REMOTE_EXTENSION})
list(APPEND Slicer_EXTENSION_SOURCE_DIRS ${${varname}})
endforeach()
foreach(extension_source_dir ${Slicer_EXTENSION_SOURCE_DIRS})
get_filename_component(extension_source_dir ${extension_source_dir} REALPATH)
get_filename_component(extension_source_dirname ${extension_source_dir} NAME_WE)
......@@ -1020,7 +1033,7 @@ foreach(extension_source_dir ${Slicer_EXTENSION_SOURCE_DIRS})
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})
set(${extension_source_dirname}_BINARY_DIR ${extensions_build_dir}/${extension_source_dirname})
add_subdirectory(
${${extension_source_dirname}_SOURCE_DIR}
${${extension_source_dirname}_BINARY_DIR}
......
......@@ -309,7 +309,7 @@ Slicer_Remote_Add(SlicerDMRI
GIT_TAG "86dc8ec85d9318ad05420962652443da6bf95b2a"
OPTION_NAME Slicer_BUILD_SlicerDMRI
OPTION_DEPENDS "Slicer_BUILD_DIFFUSION_SUPPORT"
LABELS REMOTE_MODULE
LABELS REMOTE_EXTENSION
VARS
SlicerDMRI_SUPERBUILD:BOOL=OFF
MRML_USE_vtkTeem:BOOL=ON # XXX No way to detect this in Superbuild
......
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