Commit 718f9c12 authored by jcfr's avatar jcfr
Browse files

COMP: Integrate SlicerWebGLEXport as an external project

* By keeping the source code of this project in its own github repository,
it makes review of the code, contribution, integration and
development of the code an easier process.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@19401 3bd1e089-480b-0410-8dfb-8563597acbee
parent ce080be3
......@@ -250,6 +250,11 @@ CMAKE_DEPENDENT_OPTION(
"Slicer_BUILD_QTLOADABLEMODULES AND Slicer_BUILD_MULTIVOLUME_SUPPORT" OFF)
mark_as_advanced(Slicer_BUILD_MultiVolumeExplorer)
CMAKE_DEPENDENT_OPTION(
Slicer_BUILD_SlicerWebGLExport "Build SlicerWebGLExport." ON
"Slicer_BUILD_QTSCRIPTEDMODULES" OFF)
mark_as_advanced(Slicer_BUILD_SlicerWebGLExport)
#-----------------------------------------------------------------------------
# Install no development files by default, but allow the user to get
# them installed by setting Slicer_INSTALL_DEVELOPMENT to true.
......
......@@ -24,3 +24,10 @@ if(Slicer_BUILD_MultiVolumeImporter)
)
endif()
if(Slicer_BUILD_SlicerWebGLExport)
# NOTE: SlicerWebGLExport source code is checkout using "External_SlicerWebGLExport.cmake".
add_subdirectory(
${SlicerWebGLExport_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/SlicerWebGLExport
)
endif()
......@@ -6,7 +6,6 @@ set(KIT_PYTHON_SCRIPTS
LabelStatistics.py
PerformanceTests.py
SampleData.py
WebGLExport.py
)
if(Slicer_USE_NUMPY)
......
This diff is collapsed.
......@@ -123,6 +123,10 @@ if(Slicer_BUILD_MULTIVOLUME_SUPPORT)
list(APPEND Slicer_DEPENDENCIES MultiVolumeImporter)
endif()
if(Slicer_BUILD_SlicerWebGLExport)
list(APPEND Slicer_DEPENDENCIES SlicerWebGLExport)
endif()
SlicerMacroCheckExternalProjectDependency(Slicer)
#-----------------------------------------------------------------------------
......@@ -178,6 +182,10 @@ if(Slicer_BUILD_MULTIVOLUME_SUPPORT)
)
endif()
if(Slicer_BUILD_SlicerWebGLExport)
list(APPEND ep_make_boolean_args Slicer_BUILD_SlicerWebGLExport)
endif()
# Add CTEST_USE_LAUNCHER only if already defined and enabled.
# It avoids extra overhead for manual builds and still allow the option
# to be propagated to the external project.
......@@ -282,6 +290,10 @@ if(Slicer_BUILD_CLI_SUPPORT)
endif()
endif()
if(Slicer_BUILD_SlicerWebGLExport)
list(APPEND ep_superbuild_extra_args -DSlicerWebGLExport_SOURCE_DIR:PATH=${SlicerWebGLExport_SOURCE_DIR})
endif()
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND ep_superbuild_extra_args
-DLibArchive_DIR:PATH=${LibArchive_DIR}
......
# Make sure this file is included only once
get_filename_component(CMAKE_CURRENT_LIST_FILENAME ${CMAKE_CURRENT_LIST_FILE} NAME_WE)
if(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED)
return()
endif()
set(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED 1)
# Sanity checks
if(DEFINED SlicerWebGLExport_SOURCE_DIR AND NOT EXISTS ${SlicerWebGLExport_SOURCE_DIR})
message(FATAL_ERROR "SlicerWebGLExport_SOURCE_DIR variable is defined but corresponds to non-existing directory")
endif()
# Set dependency list
set(SlicerWebGLExport_DEPENDENCIES "")
# Include dependent projects if any
SlicerMacroCheckExternalProjectDependency(SlicerWebGLExport)
set(proj SlicerWebGLExport)
if(NOT DEFINED SlicerWebGLExport_SOURCE_DIR)
#message(STATUS "${__indent}Adding project ${proj}")
ExternalProject_Add(${proj}
GIT_REPOSITORY "${git_protocol}://github.com/xtk/SlicerWebGLExport.git"
GIT_TAG "cbad9623755bbaf8da2e1259c643254a1d3bfe8f"
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
BINARY_DIR ${proj}-build
UPDATE_COMMAND ""
CMAKE_GENERATOR ${gen}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
${SlicerWebGLExport_DEPENDENCIES}
)
set(SlicerWebGLExport_SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}/WebGLExport)
else()
# The project is provided using SlicerWebGLExport_SOURCE_DIR, nevertheless since other project may depend on SlicerWebGLExport,
# let's add an 'empty' one
SlicerMacroEmptyExternalProject(${proj} "${SlicerWebGLExport_DEPENDENCIES}")
endif()
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