From 50e8dc0b62b83c034eeb90f75dfac92e7079baa8 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 29 Nov 2017 23:21:19 -0500 Subject: [PATCH] COMP: Update build system introducing Slicer_BUILD_SEGMENTATION_SUPPORT option This allows to build Slicer without segmentation support. This is particularly useful when building custom application based on Slicer. --- CMakeLists.txt | 4 ++ Libs/CMakeLists.txt | 15 ++++++- Libs/MRML/Core/CMakeLists.txt | 40 +++++++++++++------ Libs/MRML/Core/vtkMRMLConfigure.h.in | 1 + Libs/MRML/Core/vtkMRMLScene.cxx | 11 +++-- .../Widgets/qMRMLSegmentSelectorWidget.cxx | 28 ++++++++++++- .../Widgets/qMRMLSliceControllerWidget.cxx | 35 ++++++++++++++++ Modules/Loadable/CMakeLists.txt | 16 +++++++- Modules/Scripted/CMakeLists.txt | 12 ++++-- SuperBuild.cmake | 6 ++- 10 files changed, 143 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90eaedc4fb5..06dcfd3f873 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,6 +296,10 @@ option(Slicer_USE_QtTesting "Integrate QtTesting framework into Slicer." ON) mark_as_advanced(Slicer_USE_QtTesting) mark_as_superbuild(Slicer_USE_QtTesting) +option(Slicer_BUILD_SEGMENTATION_SUPPORT "Build Slicer with Segmentation support." ON) +mark_as_advanced(Slicer_BUILD_SEGMENTATION_SUPPORT) +mark_as_superbuild(Slicer_BUILD_SEGMENTATION_SUPPORT) + option(Slicer_USE_SimpleITK "Build Slicer with SimpleITK support" ON) mark_as_superbuild(Slicer_USE_SimpleITK) diff --git a/Libs/CMakeLists.txt b/Libs/CMakeLists.txt index 655515aa074..5a9b1d4c890 100644 --- a/Libs/CMakeLists.txt +++ b/Libs/CMakeLists.txt @@ -23,7 +23,13 @@ list(APPEND dirs vtkAddon vtkTeem vtkITK - vtkSegmentationCore + ) +if(Slicer_BUILD_SEGMENTATION_SUPPORT) + list(APPEND dirs + vtkSegmentationCore + ) +endif() +list(APPEND dirs FreeSurfer MRML/Core ) @@ -62,6 +68,9 @@ endif() # Qt designer plugins set(MRML_BUILD_QT_DESIGNER_PLUGINS ${Slicer_BUILD_QT_DESIGNER_PLUGINS}) +# Segmentation support +set(MRML_BUILD_SEGMENTATION_SUPPORT ${Slicer_BUILD_SEGMENTATION_SUPPORT}) + # ITKFactories directories set(MRMLIDImageIO_ITKFACTORIES_DIR ${Slicer_ITKFACTORIES_DIR}) set(MRMLIDImageIO_INSTALL_ITKFACTORIES_DIR ${Slicer_INSTALL_ITKFACTORIES_DIR}) @@ -127,13 +136,15 @@ set(MRML_LIBRARIES ${_mrml_libraries} CACHE INTERNAL "MRML libraries" FORCE) #----------------------------------------------------------------------------- set(_vtk_wrapped_libraries vtkAddon - vtkSegmentationCore vtkTeem vtkITK FreeSurfer MRMLCore MRMLLogic ) +if(Slicer_BUILD_SEGMENTATION_SUPPORT) + list(APPEND _vtk_wrapped_libraries vtkSegmentationCore) +endif() if(Slicer_USE_PYTHONQT AND VTK_WRAP_PYTHON) list(APPEND _vtk_wrapped_libraries MRMLDisplayableManager) endif() diff --git a/Libs/MRML/Core/CMakeLists.txt b/Libs/MRML/Core/CMakeLists.txt index 2b6a6f1a3fb..5c749259348 100644 --- a/Libs/MRML/Core/CMakeLists.txt +++ b/Libs/MRML/Core/CMakeLists.txt @@ -25,6 +25,11 @@ mark_as_advanced(MRML_SUPPORT_VERSION) option(MRML_USE_vtkTeem "Build MRML with vtkTeem support." ON) mark_as_advanced(MRML_USE_vtkTeem) +if(NOT DEFINED MRML_BUILD_SEGMENTATION_SUPPORT) + option(MRML_BUILD_SEGMENTATION_SUPPORT "Build MRML with Segmentation support" ON) + mark_as_advanced(MRML_BUILD_SEGMENTATION_SUPPORT) +endif() + # -------------------------------------------------------------------------- # Dependencies # -------------------------------------------------------------------------- @@ -67,9 +72,11 @@ set(include_dirs ${CMAKE_CURRENT_BINARY_DIR} ${vtkAddon_INCLUDE_DIRS} ${vtkITK_INCLUDE_DIRS} - ${vtkSegmentationCore_INCLUDE_DIRS} ${FreeSurfer_INCLUDE_DIRS} ) +if(MRML_BUILD_SEGMENTATION_SUPPORT) + list(APPEND include_dirs ${vtkSegmentationCore_INCLUDE_DIRS}) +endif() if(MRML_USE_vtkTeem) list(APPEND include_dirs ${vtkTeem_INCLUDE_DIRS}) endif() @@ -156,12 +163,6 @@ set(MRMLCore_SRCS vtkMRMLSceneViewStorageNode.cxx vtkMRMLScriptedModuleNode.cxx vtkMRMLScriptedModuleNode.h - vtkMRMLSegmentationNode.cxx - vtkMRMLSegmentationNode.h - vtkMRMLSegmentationDisplayNode.cxx - vtkMRMLSegmentationDisplayNode.h - vtkMRMLSegmentationStorageNode.cxx - vtkMRMLSegmentationStorageNode.h vtkMRMLSelectionNode.cxx vtkMRMLSliceCompositeNode.cxx vtkMRMLSliceNode.cxx @@ -212,9 +213,19 @@ set(MRMLCore_SRCS # register code to the vtkMRMLScene constructor ) +if(MRML_BUILD_SEGMENTATION_SUPPORT) + list(APPEND MRMLCore_SRCS + vtkMRMLSegmentationNode.cxx + vtkMRMLSegmentationNode.h + vtkMRMLSegmentationDisplayNode.cxx + vtkMRMLSegmentationDisplayNode.h + vtkMRMLSegmentationStorageNode.cxx + vtkMRMLSegmentationStorageNode.h + ) +endif() + if(MRML_USE_vtkTeem) - set(MRMLCore_SRCS - ${MRMLCore_SRCS} + list(APPEND MRMLCore_SRCS vtkMRMLDiffusionImageVolumeNode.cxx vtkMRMLDiffusionTensorVolumeDisplayNode.cxx vtkMRMLDiffusionTensorVolumeNode.cxx @@ -260,12 +271,14 @@ add_library(${lib_name} ${srcs}) set(libs vtkAddon vtkITK - vtkSegmentationCore ${ITK_LIBRARIES} ${VTK_LIBRARIES} vtkIOInfovis FreeSurfer ) +if(MRML_BUILD_SEGMENTATION_SUPPORT) + list(APPEND libs vtkSegmentationCore) +endif() if(MRML_USE_vtkTeem) list(APPEND libs vtkTeem) endif() @@ -381,5 +394,8 @@ endif() # -------------------------------------------------------------------------- # Set INCLUDE_DIRS variable # -------------------------------------------------------------------------- -set(${PROJECT_NAME}_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${vtkAddon_INCLUDE_DIRS} ${vtkSegmentationCore_INCLUDE_DIRS} - CACHE INTERNAL "${PROJECT_NAME} include dirs" FORCE) +set(_include_dirs ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${vtkAddon_INCLUDE_DIRS}) +if(MRML_BUILD_SEGMENTATION_SUPPORT) + list(APPEND _include_dirs ${vtkSegmentationCore_INCLUDE_DIRS}) +endif() +set(${PROJECT_NAME}_INCLUDE_DIRS ${_include_dirs} CACHE INTERNAL "${PROJECT_NAME} include dirs" FORCE) diff --git a/Libs/MRML/Core/vtkMRMLConfigure.h.in b/Libs/MRML/Core/vtkMRMLConfigure.h.in index 2ddae915e95..39cc258c537 100644 --- a/Libs/MRML/Core/vtkMRMLConfigure.h.in +++ b/Libs/MRML/Core/vtkMRMLConfigure.h.in @@ -12,6 +12,7 @@ #define VTKMRML_STATIC #endif +#cmakedefine MRML_BUILD_SEGMENTATION_SUPPORT #cmakedefine MRML_USE_TEEM #cmakedefine MRML_USE_vtkTeem diff --git a/Libs/MRML/Core/vtkMRMLScene.cxx b/Libs/MRML/Core/vtkMRMLScene.cxx index 7dd3e1fe3ad..d6ea42b12cb 100644 --- a/Libs/MRML/Core/vtkMRMLScene.cxx +++ b/Libs/MRML/Core/vtkMRMLScene.cxx @@ -47,9 +47,6 @@ Version: $Revision: 1.18 $ #include "vtkMRMLROINode.h" #include "vtkMRMLROIListNode.h" #include "vtkMRMLScriptedModuleNode.h" -#include "vtkMRMLSegmentationDisplayNode.h" -#include "vtkMRMLSegmentationNode.h" -#include "vtkMRMLSegmentationStorageNode.h" #include "vtkMRMLSelectionNode.h" #include "vtkMRMLSliceCompositeNode.h" #include "vtkMRMLSliceNode.h" @@ -71,6 +68,12 @@ Version: $Revision: 1.18 $ #include "vtkMRMLCrosshairNode.h" #include "vtkMRMLInteractionNode.h" +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT +#include "vtkMRMLSegmentationDisplayNode.h" +#include "vtkMRMLSegmentationNode.h" +#include "vtkMRMLSegmentationStorageNode.h" +#endif + #ifdef MRML_USE_vtkTeem #include "vtkMRMLNRRDStorageNode.h" #include "vtkMRMLDiffusionTensorVolumeDisplayNode.h" @@ -171,9 +174,11 @@ vtkMRMLScene::vtkMRMLScene() this->RegisterNodeClass( vtkSmartPointer< vtkMRMLROIListNode >::New() ); this->RegisterNodeClass( vtkSmartPointer< vtkMRMLSliceCompositeNode >::New() ); this->RegisterNodeClass( vtkSmartPointer< vtkMRMLScriptedModuleNode >::New() ); +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT this->RegisterNodeClass( vtkSmartPointer< vtkMRMLSegmentationDisplayNode >::New() ); this->RegisterNodeClass( vtkSmartPointer< vtkMRMLSegmentationNode >::New() ); this->RegisterNodeClass( vtkSmartPointer< vtkMRMLSegmentationStorageNode >::New() ); +#endif this->RegisterNodeClass( vtkSmartPointer< vtkMRMLSelectionNode >::New() ); this->RegisterNodeClass( vtkSmartPointer< vtkMRMLSliceNode >::New() ); this->RegisterNodeClass( vtkSmartPointer< vtkMRMLVolumeArchetypeStorageNode >::New() ); diff --git a/Libs/MRML/Widgets/qMRMLSegmentSelectorWidget.cxx b/Libs/MRML/Widgets/qMRMLSegmentSelectorWidget.cxx index d42e32e5329..a300cda21c9 100644 --- a/Libs/MRML/Widgets/qMRMLSegmentSelectorWidget.cxx +++ b/Libs/MRML/Widgets/qMRMLSegmentSelectorWidget.cxx @@ -25,19 +25,25 @@ #include "ui_qMRMLSegmentSelectorWidget.h" +#include // For MRML_BUILD_SEGMENTATION_SUPPORT + +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT #include "vtkMRMLSegmentationNode.h" #include "vtkMRMLSegmentationDisplayNode.h" #include "vtkSegmentation.h" #include "vtkSegment.h" +#endif -// VYK includes +// VTK includes #include // Qt includes #include //----------------------------------------------------------------------------- +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT static const char* NONE_DISPLAY = "None"; +#endif //----------------------------------------------------------------------------- class qMRMLSegmentSelectorWidgetPrivate: public Ui_qMRMLSegmentSelectorWidget @@ -54,8 +60,10 @@ class qMRMLSegmentSelectorWidgetPrivate: public Ui_qMRMLSegmentSelectorWidget void setMessage(QString message); public: +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT /// Segmentation MRML node containing shown segments vtkWeakPointer SegmentationNode; +#endif /// Current segment ID in case of single selection QString CurrentSegmentID; @@ -71,7 +79,9 @@ class qMRMLSegmentSelectorWidgetPrivate: public Ui_qMRMLSegmentSelectorWidget //----------------------------------------------------------------------------- qMRMLSegmentSelectorWidgetPrivate::qMRMLSegmentSelectorWidgetPrivate(qMRMLSegmentSelectorWidget& object) : q_ptr(&object) +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT , SegmentationNode(NULL) +#endif , MultiSelection(false) { } @@ -133,6 +143,7 @@ qMRMLSegmentSelectorWidget::~qMRMLSegmentSelectorWidget() //----------------------------------------------------------------------------- void qMRMLSegmentSelectorWidget::onCurrentNodeChanged(vtkMRMLNode* node) { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT Q_D(qMRMLSegmentSelectorWidget); vtkMRMLSegmentationNode* segmentationNode = vtkMRMLSegmentationNode::SafeDownCast(node); @@ -149,6 +160,9 @@ void qMRMLSegmentSelectorWidget::onCurrentNodeChanged(vtkMRMLNode* node) d->SegmentationNode = segmentationNode; this->populateSegmentCombobox(); } +#else + Q_UNUSED(node); +#endif } //------------------------------------------------------------------------------ @@ -182,6 +196,7 @@ QString qMRMLSegmentSelectorWidget::currentNodeID() //----------------------------------------------------------------------------- void qMRMLSegmentSelectorWidget::populateSegmentCombobox() { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT Q_D(qMRMLSegmentSelectorWidget); d->comboBox_Segment->clear(); @@ -263,11 +278,13 @@ void qMRMLSegmentSelectorWidget::populateSegmentCombobox() // Make sure fist segment is selected (we checked before that there is at least one segment) d->comboBox_Segment->setCurrentIndex(this->noneEnabled() ? 1 : 0); } +#endif } //----------------------------------------------------------------------------- void qMRMLSegmentSelectorWidget::onCurrentSegmentChanged(int index) { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT Q_D(qMRMLSegmentSelectorWidget); d->setMessage(QString()); @@ -289,11 +306,15 @@ void qMRMLSegmentSelectorWidget::onCurrentSegmentChanged(int index) } emit currentSegmentChanged(d->CurrentSegmentID); +#else + Q_UNUSED(index); +#endif } //----------------------------------------------------------------------------- void qMRMLSegmentSelectorWidget::onSegmentMultiSelectionChanged() { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT Q_D(qMRMLSegmentSelectorWidget); d->setMessage(QString()); @@ -310,6 +331,7 @@ void qMRMLSegmentSelectorWidget::onSegmentMultiSelectionChanged() } emit segmentSelectionChanged(d->SelectedSegmentIDs); +#endif } //----------------------------------------------------------------------------- @@ -367,6 +389,7 @@ void qMRMLSegmentSelectorWidget::setCurrentSegmentID(QString segmentID) //----------------------------------------------------------------------------- void qMRMLSegmentSelectorWidget::setSelectedSegmentIDs(QStringList segmentIDList) { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT Q_D(qMRMLSegmentSelectorWidget); if (!d->MultiSelection) @@ -413,6 +436,9 @@ void qMRMLSegmentSelectorWidget::setSelectedSegmentIDs(QStringList segmentIDList } d->CheckableComboBox_Segment->blockSignals(wasBlocked); d->CheckableComboBox_Segment->repaint(); +#else + Q_UNUSED(segmentIDList); +#endif } //-------------------------------------------------------------------------- diff --git a/Libs/MRML/Widgets/qMRMLSliceControllerWidget.cxx b/Libs/MRML/Widgets/qMRMLSliceControllerWidget.cxx index 90e2e2e1fa2..aea8607358b 100644 --- a/Libs/MRML/Widgets/qMRMLSliceControllerWidget.cxx +++ b/Libs/MRML/Widgets/qMRMLSliceControllerWidget.cxx @@ -45,10 +45,13 @@ #include // MRML includes +#include // For MRML_BUILD_SEGMENTATION_SUPPORT #include #include +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT #include #include +#endif #include #include @@ -1115,6 +1118,7 @@ void qMRMLSliceControllerWidgetPrivate::onBackgroundLayerNodeSelected(vtkMRMLNod // -------------------------------------------------------------------------- void qMRMLSliceControllerWidgetPrivate::onSegmentationNodeSelected(vtkMRMLNode* node) { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT vtkMRMLSegmentationNode* segmentationNode = vtkMRMLSegmentationNode::SafeDownCast(node); // Update segmentation visibility and opacity controls @@ -1136,11 +1140,15 @@ void qMRMLSliceControllerWidgetPrivate::onSegmentationNodeSelected(vtkMRMLNode* this, SLOT(onSegmentationNodeDisplayModifiedEvent(vtkObject*))); this->qvtkReconnect(0, segmentationNode, vtkSegmentation::SegmentRemoved, this, SLOT(onSegmentationNodeDisplayModifiedEvent(vtkObject*))); +#else + Q_UNUSED(node); +#endif } // -------------------------------------------------------------------------- void qMRMLSliceControllerWidgetPrivate::onSegmentationNodeDisplayModifiedEvent(vtkObject* nodeObject) { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT vtkMRMLSegmentationNode* segmentationNode = vtkMRMLSegmentationNode::SafeDownCast(nodeObject); if (!segmentationNode || segmentationNode != this->SegmentSelectorWidget->currentNode()) { @@ -1182,11 +1190,15 @@ void qMRMLSliceControllerWidgetPrivate::onSegmentationNodeDisplayModifiedEvent(v visibleSegmentIDs << segmentIDIt->c_str(); } this->SegmentSelectorWidget->setSelectedSegmentIDs(visibleSegmentIDs); +#else + Q_UNUSED(nodeObject); +#endif } // -------------------------------------------------------------------------- void qMRMLSliceControllerWidgetPrivate::updateSegmentationOutlineFillButton() { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT vtkMRMLSegmentationDisplayNode* displayNode = this->currentSegmentationDisplayNode(); if (!displayNode) { @@ -1215,6 +1227,7 @@ void qMRMLSliceControllerWidgetPrivate::updateSegmentationOutlineFillButton() { qWarning() << Q_FUNC_INFO << ": Invalid segmentation outline/fill state: neither are on"; } +#endif } // -------------------------------------------------------------------------- @@ -1437,6 +1450,7 @@ void qMRMLSliceControllerWidgetPrivate::applyCustomLightbox() //--------------------------------------------------------------------------- vtkMRMLSegmentationDisplayNode* qMRMLSliceControllerWidgetPrivate::currentSegmentationDisplayNode() { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT vtkMRMLSegmentationNode* segmentationNode = vtkMRMLSegmentationNode::SafeDownCast( this->SegmentSelectorWidget->currentNode() ); if (!segmentationNode) @@ -1444,6 +1458,9 @@ vtkMRMLSegmentationDisplayNode* qMRMLSliceControllerWidgetPrivate::currentSegmen return NULL; } return vtkMRMLSegmentationDisplayNode::SafeDownCast(segmentationNode->GetDisplayNode()); +#else + return NULL; +#endif } // -------------------------------------------------------------------------- @@ -1526,6 +1543,7 @@ qMRMLOrientation qMRMLSliceControllerWidgetPrivate::mrmlOrientation(const QStrin // -------------------------------------------------------------------------- void qMRMLSliceControllerWidgetPrivate::onSegmentVisibilitySelectionChanged(QStringList selectedSegmentIDs) { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT vtkMRMLSegmentationNode* segmentationNode = vtkMRMLSegmentationNode::SafeDownCast( this->SegmentSelectorWidget->currentNode() ); if (!segmentationNode) @@ -1560,6 +1578,9 @@ void qMRMLSliceControllerWidgetPrivate::onSegmentVisibilitySelectionChanged(QStr return; // This event handler runs after each check/uncheck, so handling the first mismatch is enough } } +#else + Q_UNUSED(selectedSegmentIDs); +#endif } @@ -2096,6 +2117,7 @@ void qMRMLSliceControllerWidget::rotateSliceToBackground() //--------------------------------------------------------------------------- void qMRMLSliceControllerWidget::setSegmentationHidden(bool hide) { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT Q_D(qMRMLSliceControllerWidget); vtkMRMLSegmentationDisplayNode* displayNode = d->currentSegmentationDisplayNode(); @@ -2105,6 +2127,9 @@ void qMRMLSliceControllerWidget::setSegmentationHidden(bool hide) } displayNode->SetVisibility(!hide); +#else + Q_UNUSED(hide); +#endif } //--------------------------------------------------------------------------- @@ -2139,6 +2164,7 @@ void qMRMLSliceControllerWidget::setBackgroundHidden(bool hide) //--------------------------------------------------------------------------- void qMRMLSliceControllerWidget::setSegmentationOpacity(double opacity) { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT Q_D(qMRMLSliceControllerWidget); vtkMRMLSegmentationDisplayNode* displayNode = d->currentSegmentationDisplayNode(); @@ -2148,6 +2174,9 @@ void qMRMLSliceControllerWidget::setSegmentationOpacity(double opacity) } displayNode->SetOpacity(opacity); +#else + Q_UNUSED(opacity); +#endif } //--------------------------------------------------------------------------- @@ -2203,6 +2232,7 @@ void qMRMLSliceControllerWidget::setBackgroundOpacity(double opacity) //--------------------------------------------------------------------------- void qMRMLSliceControllerWidget::toggleSegmentationOutlineFill() { +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT Q_D(qMRMLSliceControllerWidget); vtkMRMLSegmentationDisplayNode* displayNode = d->currentSegmentationDisplayNode(); if (!displayNode) @@ -2237,6 +2267,7 @@ void qMRMLSliceControllerWidget::toggleSegmentationOutlineFill() displayNode->SetVisibility2DFill(true); displayNode->SetVisibility2DOutline(true); } +#endif } //--------------------------------------------------------------------------- @@ -2759,6 +2790,7 @@ void qMRMLSliceControllerWidget::updateSegmentationControlsVisibility() Q_D(qMRMLSliceControllerWidget); +#ifdef MRML_BUILD_SEGMENTATION_SUPPORT bool popupVisible = d->MoreButton->isChecked(); // If there are any segmentation nodes in the scene and selection is None, then select the first one @@ -2775,6 +2807,9 @@ void qMRMLSliceControllerWidget::updateSegmentationControlsVisibility() // Show segmentation controls only if the popup is visible and if there are // segmentation nodes in the scene bool visible = segmentationNodesPresent && popupVisible; +#else + bool visible = false; +#endif d->SegmentationIconLabel->setVisible(visible); d->SegmentationVisibilityButton->setVisible(visible); d->SegmentationOpacitySlider->setVisible(visible); diff --git a/Modules/Loadable/CMakeLists.txt b/Modules/Loadable/CMakeLists.txt index 77d53a3fc3a..405e394bd0e 100644 --- a/Modules/Loadable/CMakeLists.txt +++ b/Modules/Loadable/CMakeLists.txt @@ -5,7 +5,13 @@ set(qtmodules AtlasCreator Cameras Units - Terminologies + ) +if(Slicer_BUILD_SEGMENTATION_SUPPORT) + list(APPEND qtmodules + Terminologies + ) +endif() +list(APPEND qtmodules Colors SubjectHierarchy Annotations @@ -16,7 +22,13 @@ set(qtmodules #Measurements Models SceneViews - Segmentations + ) +if(Slicer_BUILD_SEGMENTATION_SUPPORT) + list(APPEND qtmodules + Segmentations + ) +endif() +list(APPEND qtmodules SlicerWelcome Tables Reformat diff --git a/Modules/Scripted/CMakeLists.txt b/Modules/Scripted/CMakeLists.txt index b96cc3bc5f6..111faf661ee 100644 --- a/Modules/Scripted/CMakeLists.txt +++ b/Modules/Scripted/CMakeLists.txt @@ -4,14 +4,10 @@ include(SlicerMacroBuildScriptedModule) set(modules DataProbe DMRIInstall - Editor - EditorLib LabelStatistics PerformanceTests SampleData ScreenCapture - SegmentEditor - SegmentStatistics SelfTests SurfaceToolbox VectorToScalarVolume @@ -34,6 +30,14 @@ if(Slicer_BUILD_DICOM_SUPPORT) DICOMPatcher ) endif() +if(Slicer_BUILD_SEGMENTATION_SUPPORT) + list(APPEND modules + Editor + EditorLib + SegmentEditor + SegmentStatistics + ) +endif() foreach(module ${modules}) set(_build_module 1) set(${module}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${module}) diff --git a/SuperBuild.cmake b/SuperBuild.cmake index 570a0a8a23b..aeaec729d3a 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -119,7 +119,6 @@ set(Slicer_DEPENDENCIES ${ITK_EXTERNAL_NAME} CTK LibArchive - RapidJSON ) set(CURL_ENABLE_SSL ${Slicer_USE_PYTHONQT_WITH_OPENSSL}) @@ -128,6 +127,11 @@ if(Slicer_USE_OpenIGTLink) list(APPEND Slicer_DEPENDENCIES OpenIGTLink) endif() +if(Slicer_BUILD_SEGMENTATION_SUPPORT) + # RapidJSON used in "Terminologies" module itself used in "Segmentations" module + list(APPEND Slicer_DEPENDENCIES RapidJSON) +endif() + if(Slicer_USE_SimpleITK) list(APPEND Slicer_DEPENDENCIES SimpleITK) endif()