Commit 60c6ddb3 authored by Bill Lorensen's avatar Bill Lorensen

ENH: Reinstate Remote modules.

The new vtk module system required changes to
vtkModuleRemote.cmake. The old system used a cmake option,
Build_modulename:BOOL ON/OFF to enable a remote module. The new module
system uses a cmake variable, VTK_MODULE_ENABLE_VTK with values YES,
WANT, DONT_WANT, NO and DEFAULT.

Also, CMakeLists.txt now includes add_subdirectory(Remote) and the Remote directory is added to vtk_source_directories.

To test the new remote macros, we enabled three remote modules:
PoissonReconstruction, Powercrust and SplineDrivenImageSlicer.

The WikiExamples are no longer available as a remote module. They will instead be added as an external project in the future, WikiExamples.remote.cmake has been removed.
parent efb6c3c1
......@@ -113,27 +113,31 @@ endfunction()
# Download and turn on a remote module.
#
# The module CMake option is created: Module_${module_name}, which defaults to OFF.
# Once set to ON, the module is downloaded into the Remote module group.
# The CMake variable VTK_MODULE_ENABLE_VTK_${module_name} is created
# if it does not exist. The variable is set to DEFAULT.
# Once set to WANT or YES, the module is downloaded into the Remote module
# group.
#
# A module name and description are required. The description will show up in
# the CMake user interface.
# A module name and description are required. The description will
# show up in the CMake user interface.
#
# The following options are currently supported:
# [GIT_REPOSITORY url] # URL of git repo
# [GIT_TAG tag] # Git branch name, commit id or tag
function(vtk_fetch_module _name _description)
option(Module_${_name} "${_description}" OFF)
mark_as_advanced(Module_${_name})
# Fetch_$_remote_module} is deprecated. To maintain backward compatibility:
if(Fetch_${_name})
message(WARNING "Fetch_${_name} is deprecated, please use Module_${_name} to download and enable the remote module.")
set(Module_${_name} ON CACHE FORCE "${_description}")
# If the variable does not exist, create it and set its value to
# DEFAULT.
if(NOT VTK_MODULE_ENABLE_VTK_${_name})
set("VTK_MODULE_ENABLE_VTK_${_name}" "DEFAULT"
CACHE STRING "Enable the ${name} module. ${_description}")
mark_as_advanced("VTK_MODULE_ENABLE_VTK_${_name}")
set_property(CACHE "VTK_MODULE_ENABLE_VTK_${_name}"
PROPERTY
STRINGS "YES;WANT;DONT_WANT;NO;DEFAULT")
endif()
if(Module_${_name})
# If the variable is WANT or YES, download the module.
if (${VTK_MODULE_ENABLE_VTK_${_name}} STREQUAL "WANT" OR
${VTK_MODULE_ENABLE_VTK_${_name}} STREQUAL "YES")
vtk_download_attempt_check(Module_${_name})
include(CMakeParseArguments)
cmake_parse_arguments(_fetch_options "" "GIT_REPOSITORY;GIT_TAG" "" ${ARGN})
......@@ -146,8 +150,7 @@ function(vtk_fetch_module _name _description)
OUTPUT_VARIABLE ov
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX REPLACE "^git version (.+)$" "\\1" _version "${ov}")
if("${_version}" VERSION_LESS 1.6.6)
if(GIT_VERSION_STRING VERSION_LESS 1.6.6)
message(FATAL_ERROR "Git version 1.6.6 or later is required.")
endif()
_fetch_with_git("${GIT_EXECUTABLE}"
......
cmake_minimum_required(VERSION 3.8...3.12 FATAL_ERROR)
foreach(policy
CMP0083 # CMake 3.14
CMP0071 # CMake 3.10
)
if(POLICY ${policy})
cmake_policy(SET ${policy} NEW)
......@@ -74,7 +75,7 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
#-----------------------------------------------------------------------------
# Add the Remote Subdirectory
#add_subdirectory(Remote)
add_subdirectory(Remote)
#-----------------------------------------------------------------------------
# Does VTK require support for 64 bit file systems
......@@ -194,6 +195,7 @@ set(vtk_source_directories
"${CMAKE_CURRENT_SOURCE_DIR}/Interaction"
"${CMAKE_CURRENT_SOURCE_DIR}/IO"
"${CMAKE_CURRENT_SOURCE_DIR}/Parallel"
"${CMAKE_CURRENT_SOURCE_DIR}/Remote"
"${CMAKE_CURRENT_SOURCE_DIR}/Rendering"
"${CMAKE_CURRENT_SOURCE_DIR}/Testing"
"${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty"
......@@ -228,6 +230,7 @@ vtk_module_scan(
WANT_BY_DEFAULT "${VTK_BUILD_ALL_MODULES}"
ENABLE_TESTS "${vtk_enable_tests}")
if (vtk_required_modules OR vtk_unrecognized_modules)
message(FATAL_ERROR
"The following modules were requested or required, but not found: "
......
#
# Poisson Reconstruction
#
vtk_fetch_module(PoissonReconstruction
"Poisson Surface reconstruction from unorganized points"
GIT_REPOSITORY https://github.com/lorensen/PoissonReconstruction
# September 7, 2017 - refactored remote module
GIT_TAG ffaa97c271b8dfb91d7742dd3c05d7377d864afe
# January 29, 2019 - new vtk module support
GIT_TAG dbdd0244fe28eb81a9ebe0d11f65d9769ab91a4a
)
#
# Powercrust Reconstruction
#
vtk_fetch_module(Powercrust
"Powercrust Surface reconstruction from unorganized points"
GIT_REPOSITORY https://github.com/lorensen/Powercrust
# February 1, 2019 - updated for new vtk module API
GIT_TAG fb3d08d06fb504a431b9f5882e8086b932815cf0
)
......@@ -5,6 +5,6 @@
vtk_fetch_module(SplineDrivenImageSlicer
"Spline Driven Image Slicer - http://www.vtkjournal.org/browse/publication/838"
GIT_REPOSITORY https://github.com/lorensen/midas-journal-838.git
# First working as a remote module
GIT_TAG 7994999c1e4b56ab546527788b7c894a138e97a1
# New VTK module API January 29, 2019
GIT_TAG df5ee9ea4a9eeed2d07bbe488cc2be209bf0e49d
)
#
# VTK WikiExamples
#
# To run tests for this module
# ctest -L WikiExamples
# If the environment var WikiExamplesTag exists, use it
if (NOT DEFINED ENV{WikiExamplesTag})
# December 19 Baseline additions
set(GIT_TAG 744133bb3c344e09817ca27e3a10e3e0f2a02e11)
else()
set(GIT_TAG $ENV{WikiExamplesTag})
endif()
vtk_fetch_module(WikiExamples
"A collection of examples that illustrate how to use VTK."
GIT_REPOSITORY https://github.com/lorensen/VTKExamples.git
GIT_TAG ${GIT_TAG}
)
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