Commit d09a6391 authored by jcfr's avatar jcfr

ENH: BuildSystem: Consolidate handling of remote module/extension directories

This commit simplifies handling of remote module, remove extension and
extension directories.

It also updates BRAINSTools to the expected hash omitted in r26663:

$ git shortlog 42ac3c3..4f25a8a --no-merges
Jean-Christophe Fillion-Robin (1):
      COMP: Support integration with Slicer setting LAUNCH_EXE using SEM_LAUNCH_COMMAND

git-svn-id: http://svn.slicer.org/Slicer4/trunk@26665 3bd1e089-480b-0410-8dfb-8563597acbee
parent f40cd9c6
......@@ -1058,29 +1058,26 @@ configure_file(
${Slicer_SOURCE_DIR}/CMake/SlicerConfig.cmake.in
${Slicer_DIR}/SlicerConfig.cmake @ONLY)
message(STATUS "--------------------------------------------------")
message(STATUS "Configuring remote modules")
message(STATUS "--------------------------------------------------")
add_subdirectory(Modules/Remote)
# --------------------------------------------------------------------------
# Add remote extension source directories.
#
# Directories can be set in two ways:
# Directories can be set in three ways:
#
# (1) Automatically by specifying the label 'REMOTE_MODULE' when
# calling 'Slicer_Remote_Add' from SuperBuild.cmake.
#
# (1) Automatically by specifying the label 'REMOTE_EXTENSION' when
# (2) 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:
# (3) 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})
function(_add_extension_source_dir extension_source_dir what)
get_filename_component(extension_source_dir ${extension_source_dir} REALPATH)
get_filename_component(extension_source_dirname ${extension_source_dir} NAME_WE)
message(STATUS "--------------------------------------------------")
message(STATUS "Configuring extension: ${extension_source_dirname}")
message(STATUS "Configuring ${what}: ${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 ${extensions_build_dir}/${extension_source_dirname})
......@@ -1088,7 +1085,18 @@ foreach(extension_source_dir ${Slicer_EXTENSION_SOURCE_DIRS})
${${extension_source_dirname}_SOURCE_DIR}
${${extension_source_dirname}_BINARY_DIR}
)
endfunction()
foreach(varname ${Slicer_EP_LABEL_REMOTE_MODULE})
_add_extension_source_dir(${${varname}} "remote module")
endforeach()
foreach(varname ${Slicer_EP_LABEL_REMOTE_EXTENSION})
_add_extension_source_dir(${${varname}} "remote extension")
endforeach()
foreach(extension_source_dir ${Slicer_EXTENSION_SOURCE_DIRS})
_add_extension_source_dir(${extension_source_dir} "extension directory")
endforeach()
unset(Slicer_DIR)
# --------------------------------------------------------------------------
......
if(Slicer_EP_LABEL_REMOTE_MODULE)
foreach(varname ${Slicer_EP_LABEL_REMOTE_MODULE})
set(_source_dir ${${varname}})
get_filename_component(_project_name ${_source_dir} NAME_WE)
add_subdirectory(
${_source_dir}
${CMAKE_CURRENT_BINARY_DIR}/${_project_name}
)
endforeach()
endif()
......@@ -305,7 +305,7 @@ Slicer_Remote_Add(BRAINSTools
GIT_REPOSITORY "${git_protocol}://github.com/Slicer/BRAINSTools.git"
# Include patches:
# - for supporting integration with Slicer setting LAUNCH_EXE using SEM_LAUNCH_COMMAND
GIT_TAG "42ac3c373865e19526e1be060b2b67846f7beecd" # master (from 2017-11-29, post v4.7.1)
GIT_TAG "4f25a8a1226c38c60b0cd2210079beb71d5b3e44" # master (from 2017-11-29, post v4.7.1)
OPTION_NAME Slicer_BUILD_BRAINSTOOLS
OPTION_DEPENDS "Slicer_BUILD_CLI_SUPPORT;Slicer_BUILD_CLI"
LABELS REMOTE_MODULE
......
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