Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 29 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
cmake_minimum_required(VERSION 3.16.3...3.19.7 FATAL_ERROR)
cmake_minimum_required(VERSION 3.17...4.0)

project(LayerDisplayableManager)
project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION})

#-----------------------------------------------------------------------------
# Extension meta-information
set(EXTENSION_HOMEPAGE "https://github.com/KitwareMedical/SlicerLayerDisplayableManager")
set(EXTENSION_CONTRIBUTORS "Thibault Pelletier (Kitware SAS)")
set(EXTENSION_DESCRIPTION "A 3D Slicer module introducing a new displayable manager architecture for layered rendering and interaction handling.")
set(EXTENSION_ICONURL "https://github.com/KitwareMedical/SlicerLayerDisplayableManager/raw/main/Docs/LayerDisplayableManager.png")
set(EXTENSION_SCREENSHOTURLS "https://github.com/KitwareMedical/SlicerLayerDisplayableManager/raw/main/Docs/LayeredDisplayableManager_UML.jpg")
set(EXTENSION_DEPENDS "NA") # Specified as a list or "NA" if no dependencies
find_package(Slicer CONFIG REQUIRED)

#-----------------------------------------------------------------------------
# Extension dependencies
find_package(Slicer REQUIRED)
include(${Slicer_USE_FILE})
include(FetchContent)
FetchContent_Declare(vtk-sdk-python-helper
GIT_REPOSITORY https://github.com/Kitware/vtk-sdk-python-wheel-helper.git
GIT_TAG main
)
FetchContent_MakeAvailable(vtk-sdk-python-helper)

#-----------------------------------------------------------------------------
# Extension modules
add_subdirectory(LayerDM)
set(modules
SlicerLayerDM::Logic
SlicerLayerDM::MRML
SlicerLayerDM::MRMLDisplayableManager
)

#-----------------------------------------------------------------------------
include(${Slicer_EXTENSION_GENERATE_CONFIG})
include(${Slicer_EXTENSION_CPACK})
# Install runtime only dependencies
vtksdk_build_modules(${SKBUILD_PROJECT_NAME}
MODULES ${modules}
DEPENDENCIES slicer_core
)
vtksdk_generate_package_init(${SKBUILD_PROJECT_NAME}
MODULES ${modules}
DEPENDENCIES slicer_core
)

# Make this package part of the slicer meta package
install(FILES
${CMAKE_SOURCE_DIR}/Python/slicer_layerdm.py
DESTINATION slicer
)
2 changes: 1 addition & 1 deletion LayerDM/Logic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set(headers
"${CMAKE_CURRENT_BINARY_DIR}/vtkSlicerLayerDMVersion.h"
)

vtk_module_add_module(VTK::SlicerLayerDMModuleLogic
vtk_module_add_module(SlicerLayerDM::Logic
EXPORT_MACRO_PREFIX VTK_SLICER_LAYERDM_MODULE_LOGIC
CLASSES ${classes}
HEADERS ${headers}
Expand Down
4 changes: 2 additions & 2 deletions LayerDM/Logic/vtk.module
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
NAME
VTK::SlicerLayerDMModuleLogic
SlicerLayerDM::Logic
LIBRARY_NAME
vtkSlicerLayerDMModuleLogic
DEPENDS
VTK::SlicerLayerDMModuleMRML
SlicerLayerDM::MRML
DESCRIPTION
"vtkSlicerLayerDMModuleLogic"
12 changes: 3 additions & 9 deletions LayerDM/MRML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ set(classes
vtkMRMLLayerDMObjectEventObserver
vtkMRMLLayerDMWidgetEventTranslationNode
vtkMRMLLayerDMSelectionObserver
vtkMRMLLayerDMObjectEventObserverScripted
vtkMRMLLayerDMPythonUtil
)

if (VTK_WRAP_PYTHON)
list(APPEND classes
vtkMRMLLayerDMObjectEventObserverScripted
vtkMRMLLayerDMPythonUtil
)
endif ()


vtk_module_add_module(VTK::SlicerLayerDMModuleMRML
vtk_module_add_module(SlicerLayerDM::MRML
EXPORT_MACRO_PREFIX VTK_SLICER_LAYERDM_MODULE_MRML
CLASSES ${classes}
)
6 changes: 3 additions & 3 deletions LayerDM/MRML/vtk.module
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
NAME
VTK::SlicerLayerDMModuleMRML
SlicerLayerDM::MRML
LIBRARY_NAME
vtkSlicerLayerDMModuleMRML
DEPENDS
VTK::SlicerBaseLogic
VTK::MRMLCore
Slicer::BaseLogic
Slicer::MRMLCore
DESCRIPTION
"vtkSlicerLayerDMModuleMRML"
17 changes: 6 additions & 11 deletions LayerDM/MRMLDM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@ set(classes
vtkMRMLLayerDMPipelineI
vtkMRMLLayerDMPipelineManager
vtkMRMLLayerDisplayableManager
vtkMRMLLayerDMPipelineScriptedCreator
vtkMRMLLayerDMScriptedPipelineBridge
)

if (VTK_WRAP_PYTHON)
list(APPEND classes
vtkMRMLLayerDMPipelineScriptedCreator
vtkMRMLLayerDMScriptedPipelineBridge
)

add_subdirectory(Python)
endif ()

# Handle factory registration
set(factory_classes
vtkMRMLLayerDisplayableManager
Expand All @@ -35,12 +28,14 @@ vtk_object_factory_configure(
EXPORT_MACRO "")

# Module configuration
vtk_module_add_module(VTK::SlicerLayerDMModuleMRMLDisplayableManager
vtk_module_add_module(SlicerLayerDM::MRMLDisplayableManager
EXPORT_MACRO_PREFIX VTK_SLICER_LAYERDM_MODULE_MRMLDISPLAYABLEMANAGER
CLASSES ${classes}
SOURCES ${vtk_object_factory_source}
PRIVATE_HEADERS ${vtk_object_factory_header}
)

vtk_module_definitions(VTK::SlicerLayerDMModuleMRMLDisplayableManager PRIVATE
vtk_module_definitions(SlicerLayerDM::MRMLDisplayableManager PRIVATE
"vtkSlicerLayerDMModuleMRMLDisplayableManager_AUTOINIT=1(vtkSlicerLayerDMModuleMRMLDisplayableManager)")

add_subdirectory(Python)
6 changes: 3 additions & 3 deletions LayerDM/MRMLDM/vtk.module
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
NAME
VTK::SlicerLayerDMModuleMRMLDisplayableManager
SlicerLayerDM::MRMLDisplayableManager
LIBRARY_NAME
vtkSlicerLayerDMModuleMRMLDisplayableManager
IMPLEMENTABLE
DEPENDS
VTK::MRMLDisplayableManager
VTK::SlicerLayerDMModuleMRML
Slicer::MRMLDisplayableManager
SlicerLayerDM::MRML
DESCRIPTION
"vtkSlicerLayerDMModuleMRMLDisplayableManager"
2 changes: 2 additions & 0 deletions Python/slicer_layerdm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Entry point for slicer dummy package
from slicer_layerdm import *
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build-system]
requires = ["scikit-build-core", "slicer-core-sdk==5.12.0", "vtk-sdk==9.6.0"]
build-backend = "scikit_build_core.build"

[project]
name = "slicer-layerdm"
version = "1.0.0"
authors = [
{ name = "Alexy Pellegrini", email = "alexy.pellegrini@kitware.com" }
]
dependencies = ["slicer-core"]