Commit 26b47b35 authored by jcfr's avatar jcfr

ENH: Add Slicer_BUILD_EXTENSIONMANAGER_SUPPORT option

* If disabled:
 - extension manager won't be integrated
 - external project qCDashAPI and LibArchive won't be checkedout

git-svn-id: http://svn.slicer.org/Slicer4/trunk@18931 3bd1e089-480b-0410-8dfb-8563597acbee
parent 6c32421c
......@@ -35,9 +35,11 @@
// SlicerQt includes
#include "qSlicerMainWindow.h"
#include "ui_qSlicerMainWindow.h"
#include "qSlicerApplication.h"
#include "qSlicerApplication.h" // Indirectly includes vtkSlicerConfigure.h
#include "qSlicerAbstractModule.h"
#include "qSlicerExtensionsWizard.h"
#ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
# include "qSlicerExtensionsWizard.h"
#endif
#include "qSlicerLayoutManager.h"
#include "qSlicerModuleManager.h"
#include "qSlicerMainWindowCore.h"
......@@ -47,7 +49,7 @@
#include "qSlicerSettingsGeneralPanel.h"
#ifdef Slicer_USE_PYTHONQT
#include "qSlicerSettingsPythonPanel.h"
# include "qSlicerSettingsPythonPanel.h"
#endif
// qMRML includes
......@@ -557,6 +559,10 @@ void qSlicerMainWindow::setupMenuActions()
connect(d->actionModuleHome, SIGNAL(triggered()),
this, SLOT(setHomeModuleCurrent()));
#ifndef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
d->actionViewExtensionManager->setVisible(false);
#endif
}
#undef qSlicerMainWindowCore_connect
......@@ -569,8 +575,10 @@ void qSlicerMainWindow::onEditApplicationSettingsActionTriggered()
//---------------------------------------------------------------------------
void qSlicerMainWindow::onViewExtensionManagerActionTriggered()
{
#ifdef Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
qSlicerExtensionsWizard extensionsManager(this);
extensionsManager.exec();
#endif
}
//---------------------------------------------------------------------------
......
......@@ -85,8 +85,6 @@ set(SlicerBaseLogic_SRCS
vtkSlicerColorLogic.cxx
vtkDataIOManagerLogic.cxx
# slicer's vtk extensions (filters)
vtkSlicerExtensionsLogic.cxx
vtkArchive.cxx
vtkImageSlicePaint.cxx
vtkImageFillROI.cxx
vtkSlicerGlyphSource2D.cxx
......@@ -102,6 +100,17 @@ set(SlicerBaseLogic_SRCS
vtkImageStash.cxx
)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND SlicerBaseLogic_SRCS
vtkSlicerExtensionsLogic.cxx
vtkArchive.cxx
)
set_source_files_properties(
vtkArchive.cxx
WRAP_EXCLUDE
)
endif()
if(Slicer_USE_PYTHONQT)
list(APPEND SlicerBaseLogic_SRCS
vtkSlicerScriptedLoadableModuleLogic.cxx
......@@ -110,7 +119,6 @@ endif()
set_source_files_properties(
vtkPichonFastMarchingPDF.cxx
vtkArchive.cxx
WRAP_EXCLUDE
)
......@@ -142,9 +150,14 @@ set(libs
FreeSurfer
${VTK_LIBRARIES}
RemoteIO
${LibArchive_LIBRARY}
)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND libs
${LibArchive_LIBRARY}
)
endif()
if(Slicer_BUILD_CLI_SUPPORT)
list(APPEND libs
MRMLCLI
......
set(KIT BaseLogic)
set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "DEBUG_LEAKS_ENABLE_EXIT_ERROR();" )
create_test_sourcelist(Tests ${KIT}CxxTests.cxx
vtkArchiveTest1.cxx
set(KIT_TEST_SRCS
vtkDataIOManagerLogicTest1.cxx
vtkSlicerApplicationLogicTest1.cxx
vtkSlicerColorLogicTest1.cxx
vtkSlicerTransformLogicTest1.cxx
)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND KIT_TEST_SRCS
vtkArchiveTest1.cxx
)
endif()
create_test_sourcelist(Tests ${KIT}CxxTests.cxx
${KIT_TEST_SRCS}
EXTRA_INCLUDE TestingMacros.h
)
......@@ -23,7 +30,9 @@ macro(SIMPLE_TEST TESTNAME)
set_property(TEST ${TESTNAME} PROPERTY LABELS ${LIBRARY_NAME})
endmacro()
SIMPLE_TEST( vtkArchiveTest1 ${CMAKE_CURRENT_SOURCE_DIR}/vol.zip)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
SIMPLE_TEST( vtkArchiveTest1 ${CMAKE_CURRENT_SOURCE_DIR}/vol.zip)
endif()
SIMPLE_TEST( vtkDataIOManagerLogicTest1 )
SIMPLE_TEST( vtkSlicerApplicationLogicTest1 )
SIMPLE_TEST( vtkSlicerColorLogicTest1 )
......
......@@ -33,15 +33,6 @@ set(KIT_SRCS
qSlicerDirectoryListView.cxx
qSlicerDirectoryListView.h
qSlicerExtensionsWizard.cxx
qSlicerExtensionsWizard.h
qSlicerExtensionsWizardOverviewPage.cxx
qSlicerExtensionsWizardOverviewPage.h
qSlicerExtensionsWizardRestartPage.cxx
qSlicerExtensionsWizardRestartPage.h
qSlicerExtensionsWizardWelcomePage.cxx
qSlicerExtensionsWizardWelcomePage.h
qSlicerFileDialog.cxx
qSlicerFileDialog.h
qSlicerIOManager.cxx
......@@ -84,6 +75,19 @@ set(KIT_SRCS
qSlicerWidget.h
)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND KIT_SRCS
qSlicerExtensionsWizard.cxx
qSlicerExtensionsWizard.h
qSlicerExtensionsWizardOverviewPage.cxx
qSlicerExtensionsWizardOverviewPage.h
qSlicerExtensionsWizardRestartPage.cxx
qSlicerExtensionsWizardRestartPage.h
qSlicerExtensionsWizardWelcomePage.cxx
qSlicerExtensionsWizardWelcomePage.h
)
endif()
if(Slicer_USE_PYTHONQT)
list(APPEND KIT_SRCS
qSlicerScriptedLoadableModuleFactory.cxx
......@@ -124,10 +128,6 @@ set(KIT_MOC_SRCS
qSlicerDataDialog.h
qSlicerDataDialog_p.h
qSlicerDirectoryListView.h
qSlicerExtensionsWizard.h
qSlicerExtensionsWizardOverviewPage.h
qSlicerExtensionsWizardRestartPage.h
qSlicerExtensionsWizardWelcomePage.h
qSlicerFileDialog.h
qSlicerIOManager.h
qSlicerIOOptionsWidget.h
......@@ -148,9 +148,18 @@ set(KIT_MOC_SRCS
qSlicerSettingsGeneralPanel.h
qSlicerViewersToolBar.h
qSlicerViewersToolBar_p.h
qSlicerWidget.h
qSlicerWidget.h
)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND KIT_MOC_SRCS
qSlicerExtensionsWizard.h
qSlicerExtensionsWizardOverviewPage.h
qSlicerExtensionsWizardRestartPage.h
qSlicerExtensionsWizardWelcomePage.h
)
endif()
if(Slicer_USE_PYTHONQT)
list(APPEND KIT_MOC_SRCS
qSlicerScriptedLoadableModule.h
......@@ -169,15 +178,19 @@ endif()
set(KIT_UI_SRCS
Resources/UI/qSlicerActionsDialog.ui
Resources/UI/qSlicerDataDialog.ui
Resources/UI/qSlicerExtensionsWizardWelcomePage.ui
Resources/UI/qSlicerExtensionsWizardOverviewPage.ui
Resources/UI/qSlicerExtensionsWizardRestartPage.ui
Resources/UI/qSlicerModelsDialog.ui
Resources/UI/qSlicerModulePanel.ui
Resources/UI/qSlicerSaveDataDialog.ui
Resources/UI/qSlicerSettingsModulesPanel.ui
Resources/UI/qSlicerSettingsGeneralPanel.ui
)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND KIT_UI_SRCS
Resources/UI/qSlicerExtensionsWizardWelcomePage.ui
Resources/UI/qSlicerExtensionsWizardOverviewPage.ui
Resources/UI/qSlicerExtensionsWizardRestartPage.ui
)
endif()
# PythonQt decorator
if(Slicer_USE_PYTHONQT)
......@@ -189,11 +202,16 @@ endif()
# Additional Target libraries (QT libs already included)
set(KIT_target_libraries
MRMLDisplayableManager
qCDashAPI
qSlicerBaseQTCore
qMRMLWidgets
)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND KIT_target_libraries
qCDashAPI
)
endif()
# Python wrap
if(Slicer_USE_PYTHONQT)
list(APPEND KIT_target_libraries
......
......@@ -2,18 +2,25 @@ if(BUILD_TESTING)
# Code specfic to Slicer testing is added here.
set(KIT QTGUI)
set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "DEBUG_LEAKS_ENABLE_EXIT_ERROR();" )
create_test_sourcelist(Tests ${KIT}CxxTests.cxx
set(KIT_TEST_SRCS
qSlicerAbstractModuleTest1.cxx
qSlicerAbstractModuleWidgetTest1.cxx
qSlicerApplicationTest1.cxx
qSlicerDataDialogTest1.cxx
qSlicerDirectoryListViewTest1.cxx
qSlicerExtensionsWizardTest1.cxx
qSlicerLayoutManagerTest1.cxx
qSlicerLoadableModuleTest1.cxx
qSlicerModulePanelTest1.cxx
qSlicerWidgetTest1.cxx
qSlicerWidgetTest2.cxx
)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND KIT_TEST_SRCS
qSlicerExtensionsWizardTest1.cxx
)
endif()
create_test_sourcelist(Tests ${KIT}CxxTests.cxx
${KIT_TEST_SRCS}
EXTRA_INCLUDE TestingMacros.h
)
......@@ -40,12 +47,14 @@ if(BUILD_TESTING)
SIMPLE_TEST( qSlicerAbstractModuleWidgetTest1 )
SIMPLE_TEST( qSlicerDataDialogTest1 )
SIMPLE_TEST( qSlicerDirectoryListViewTest1 )
SIMPLE_TEST( qSlicerExtensionsWizardTest1 )
SIMPLE_TEST( qSlicerLayoutManagerTest1 )
SIMPLE_TEST( qSlicerLoadableModuleTest1 )
SIMPLE_TEST( qSlicerModulePanelTest1 )
SIMPLE_TEST( qSlicerWidgetTest1 )
SIMPLE_TEST( qSlicerWidgetTest2 )
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
SIMPLE_TEST( qSlicerExtensionsWizardTest1 )
endif()
endif()
......
......@@ -23,6 +23,7 @@ set(Slicer_USE_OpenIGTLink "@Slicer_USE_OpenIGTLink@")
set(Slicer_USE_PYTHONQT "@Slicer_USE_PYTHONQT@")
set(Slicer_USE_PYTHONQT_WITH_TCL "@Slicer_USE_PYTHONQT_WITH_TCL@")
set(Slicer_BUILD_CLI_SUPPORT "@Slicer_BUILD_CLI_SUPPORT@")
set(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT "@Slicer_BUILD_EXTENSIONMANAGER_SUPPORT@")
# Qt
__SLICER_SET_OR_COMPLAIN_IF_DEFINED(QT_QMAKE_EXECUTABLE "@QT_QMAKE_EXECUTABLE_CONFIG@")
......@@ -46,7 +47,9 @@ if(Slicer_USE_PYTHONQT)
__SLICER_SET_OR_COMPLAIN_IF_DEFINED(PYTHON_DEBUG_LIBRARY "@PYTHON_DEBUG_LIBRARY_CONFIG@" CACHE FILEPATH "Path to Python debug library" FORCE)
endif()
endif()
__SLICER_SET_OR_COMPLAIN_IF_DEFINED(qCDashAPI_DIR "@qCDashAPI_DIR_CONFIG@" CACHE PATH "Path to qCDashAPI build or install directory" FORCE)
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
__SLICER_SET_OR_COMPLAIN_IF_DEFINED(qCDashAPI_DIR "@qCDashAPI_DIR_CONFIG@" CACHE PATH "Path to qCDashAPI build or install directory" FORCE)
endif()
__SLICER_SET_OR_COMPLAIN_IF_DEFINED(SLICERLIBCURL_DIR "@SLICERLIBCURL_DIR_CONFIG@" CACHE PATH "Path to Curl build or install directory" FORCE)
if(Slicer_BUILD_CLI_SUPPORT)
__SLICER_SET_OR_COMPLAIN_IF_DEFINED(SlicerExecutionModel_DIR "@SlicerExecutionModel_DIR_CONFIG@" CACHE PATH "Path to SlicerExecutionModel build or install directory" FORCE)
......
......@@ -56,7 +56,9 @@ if(Slicer_USE_BatchMake)
endif()
set(CTK_DIR_CONFIG ${CTK_DIR})
set(ITK_DIR_CONFIG ${ITK_DIR})
set(qCDashAPI_DIR_CONFIG ${qCDashAPI_DIR})
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
set(qCDashAPI_DIR_CONFIG ${qCDashAPI_DIR})
endif()
if(Slicer_USE_OpenIGTLink)
set(OpenIGTLink_DIR_CONFIG ${OpenIGTLink_DIR})
endif()
......@@ -76,11 +78,14 @@ set(Teem_DIR_CONFIG ${Teem_DIR})
set(VTK_DIR_CONFIG ${VTK_DIR})
# List all required external project
set(Slicer_EXTERNAL_PROJECTS_CONFIG CTK ITK qCDashAPI SLICERLIBCURL Teem VTK)
set(Slicer_EXTERNAL_PROJECTS_CONFIG CTK ITK SLICERLIBCURL Teem VTK)
set(Slicer_EXTERNAL_PROJECTS_NO_USEFILE_CONFIG)
if(Slicer_BUILD_CLI_SUPPORT)
list(APPEND Slicer_EXTERNAL_PROJECTS_CONFIG SlicerExecutionModel)
endif()
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND Slicer_EXTERNAL_PROJECTS_CONFIG qCDashAPI)
endif()
if(Slicer_USE_BatchMake)
list(APPEND Slicer_EXTERNAL_PROJECTS_CONFIG BatchMake)
endif()
......
......@@ -20,6 +20,7 @@ set(Slicer_PATCH_VERSION "@Slicer_PATCH_VERSION@")
# Whether Slicer was built with modules and CLI support.
set(Slicer_BUILD_CLI_SUPPORT "@Slicer_BUILD_CLI_SUPPORT@")
set(Slicer_BUILD_CLI "@Slicer_BUILD_CLI@")
set(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT "@Slicer_BUILD_EXTENSIONMANAGER_SUPPORT@")
set(Slicer_BUILD_QTLOADABLEMODULES "@Slicer_BUILD_QTLOADABLEMODULES@")
# Whether Slicer was built with shared libraries.
......
......@@ -42,6 +42,8 @@
#define Slicer_QtPlugins_DIR "@Slicer_QtPlugins_DIR@"
#cmakedefine Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
#cmakedefine Slicer_BUILD_CLI_SUPPORT
#cmakedefine Slicer_BUILD_CLI
#define Slicer_CLIMODULES_SUBDIR "@Slicer_CLIMODULES_SUBDIR@"
......
......@@ -174,6 +174,7 @@ CMAKE_DEPENDENT_OPTION(
Slicer_BUILD_LEGACY_CLI "Build Slicer LEGACY_CLI Plugins" ON
"Slicer_BUILD_CLI" OFF
)
option(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT "Build Slicer extension manager" ON)
option(Slicer_BUILD_EXTENSIONS "Build Slicer 'trusted' extensions" OFF)
CMAKE_DEPENDENT_OPTION(
Slicer_UPLOAD_EXTENSIONS "Build, test, package and upload extensions" OFF
......@@ -524,8 +525,10 @@ include(${CTK_USE_FILE})
#-----------------------------------------------------------------------------
# qCDashAPI
#-----------------------------------------------------------------------------
find_package(qCDashAPI REQUIRED)
include(${qCDashAPI_USE_FILE})
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
find_package(qCDashAPI REQUIRED)
include(${qCDashAPI_USE_FILE})
endif()
#-----------------------------------------------------------------------------
# Qt
......@@ -597,17 +600,19 @@ include(${SLICERLIBCURL_USE_FILE})
#-----------------------------------------------------------------------------
# LibArchive
#-----------------------------------------------------------------------------
set(LibArchive_INCLUDE_DIR ${LibArchive_DIR}/include)
if(WIN32)
set(LibArchive_LIBRARY ${LibArchive_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}archive.lib)
else()
set(LibArchive_LIBRARY ${LibArchive_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}archive${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
foreach(var LibArchive_LIBRARY LibArchive_INCLUDE_DIR)
if(NOT EXISTS "${${var}}")
message(FATAL_ERROR "error: ${var} corresponds to an inexistant file or directory. [${${var}}]")
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
set(LibArchive_INCLUDE_DIR ${LibArchive_DIR}/include)
if(WIN32)
set(LibArchive_LIBRARY ${LibArchive_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}archive.lib)
else()
set(LibArchive_LIBRARY ${LibArchive_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}archive${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endforeach()
foreach(var LibArchive_LIBRARY LibArchive_INCLUDE_DIR)
if(NOT EXISTS "${${var}}")
message(FATAL_ERROR "error: ${var} corresponds to an inexistant file or directory. [${${var}}]")
endif()
endforeach()
endif()
#-----------------------------------------------------------------------------
# BatchMake
......
......@@ -65,7 +65,7 @@ endif()
set(ITK_EXTERNAL_NAME ITKv${ITK_VERSION_MAJOR})
set(Slicer_DEPENDENCIES LibArchive cmcurl teem VTK ${ITK_EXTERNAL_NAME} CTK qCDashAPI)
set(Slicer_DEPENDENCIES cmcurl teem VTK ${ITK_EXTERNAL_NAME} CTK)
if(Slicer_USE_OpenIGTLink)
list(APPEND Slicer_DEPENDENCIES OpenIGTLink)
......@@ -93,6 +93,9 @@ if(Slicer_BUILD_CLI_SUPPORT)
list(APPEND Slicer_DEPENDENCIES SkullStripper)
endif()
endif()
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND Slicer_DEPENDENCIES LibArchive qCDashAPI)
endif()
if(Slicer_USE_BatchMake)
list(APPEND Slicer_DEPENDENCIES BatchMake)
endif()
......@@ -138,6 +141,7 @@ set(ep_cmake_boolean_args
WITH_MEMCHECK
Slicer_BUILD_CLI
Slicer_BUILD_CLI_SUPPORT
Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
Slicer_BUILD_QTLOADABLEMODULES
Slicer_BUILD_QTSCRIPTEDMODULES
Slicer_BUILD_OpenIGTLinkIF
......@@ -255,6 +259,13 @@ if(Slicer_BUILD_CLI_SUPPORT)
endif()
endif()
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND ep_superbuild_extra_args
-DLibArchive_DIR:PATH=${LibArchive_DIR}
-DqCDashAPI_DIR:PATH=${qCDashAPI_DIR}
)
endif()
# Set CMake OSX variable to pass down the external project
set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS)
if(APPLE)
......@@ -303,14 +314,10 @@ ExternalProject_Add(${proj}
-DVTK_DEBUG_LEAKS:BOOL=${Slicer_USE_VTK_DEBUG_LEAKS}
# cmcurl
-DSLICERLIBCURL_DIR:PATH=${SLICERLIBCURL_DIR}
# LibArchive
-DLibArchive_DIR:PATH=${LibArchive_DIR}
# Qt
-DQT_QMAKE_EXECUTABLE:PATH=${QT_QMAKE_EXECUTABLE}
# CTK
-DCTK_DIR:PATH=${CTK_DIR}
# qCDashAPI
-DqCDashAPI_DIR:PATH=${qCDashAPI_DIR}
INSTALL_COMMAND ""
)
......
......@@ -196,7 +196,10 @@ function(fixup_bundle_with_plugins app)
if(Slicer_BUILD_CLI_SUPPORT)
list(APPEND libs_path "@SlicerExecutionModel_DIR@/ModuleDescriptionParser/bin")
endif()
list(APPEND libs_path "@LibArchive_DIR@/lib")
set(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT "@Slicer_BUILD_EXTENSIONMANAGER_SUPPORT@")
if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
list(APPEND libs_path "@LibArchive_DIR@/lib")
endif()
set(Slicer_USE_BatchMake "@Slicer_USE_BatchMake@")
if(Slicer_USE_BatchMake)
list(APPEND libs_path "@BatchMake_DIR@/bin")
......
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