Skip to content

Commit ec64ae6

Browse files
COMP: Build SlicerLayerDM as vtk modules based on the slicer_core_sdk
1 parent d476888 commit ec64ae6

File tree

8 files changed

+49
-49
lines changed

8 files changed

+49
-49
lines changed

CMakeLists.txt

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
1-
cmake_minimum_required(VERSION 3.16.3...3.19.7 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.17...4.0)
22

3-
project(LayerDisplayableManager)
3+
project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION})
44

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

14-
#-----------------------------------------------------------------------------
15-
# Extension dependencies
16-
find_package(Slicer REQUIRED)
17-
include(${Slicer_USE_FILE})
7+
include(FetchContent)
8+
FetchContent_Declare(vtk-sdk-python-helper
9+
GIT_REPOSITORY https://github.com/Kitware/vtk-sdk-python-wheel-helper.git
10+
GIT_TAG main
11+
)
12+
FetchContent_MakeAvailable(vtk-sdk-python-helper)
1813

19-
#-----------------------------------------------------------------------------
20-
# Extension modules
21-
add_subdirectory(LayerDM)
14+
set(modules
15+
SlicerLayerDM::Logic
16+
SlicerLayerDM::MRML
17+
SlicerLayerDM::MRMLDisplayableManager
18+
)
2219

23-
#-----------------------------------------------------------------------------
24-
include(${Slicer_EXTENSION_GENERATE_CONFIG})
25-
include(${Slicer_EXTENSION_CPACK})
20+
# Install runtime only dependencies
21+
vtksdk_build_modules(${SKBUILD_PROJECT_NAME}
22+
MODULES ${modules}
23+
DEPENDENCIES slicer_core
24+
)
25+
vtksdk_generate_package_init(${SKBUILD_PROJECT_NAME}
26+
MODULES ${modules}
27+
DEPENDENCIES slicer_core
28+
)
29+
30+
# Make this package part of the slicer meta package
31+
install(FILES
32+
${CMAKE_SOURCE_DIR}/Python/slicer_layerdm.py
33+
DESTINATION slicer
34+
)

LayerDM/Logic/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(headers
1616
"${CMAKE_CURRENT_BINARY_DIR}/vtkSlicerLayerDMVersion.h"
1717
)
1818

19-
vtk_module_add_module(VTK::SlicerLayerDMModuleLogic
19+
vtk_module_add_module(SlicerLayerDM::Logic
2020
EXPORT_MACRO_PREFIX VTK_SLICER_LAYERDM_MODULE_LOGIC
2121
CLASSES ${classes}
2222
HEADERS ${headers}

LayerDM/Logic/vtk.module

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
NAME
2-
VTK::SlicerLayerDMModuleLogic
2+
SlicerLayerDM::Logic
33
LIBRARY_NAME
44
vtkSlicerLayerDMModuleLogic
55
DEPENDS
6-
VTK::SlicerLayerDMModuleMRML
6+
SlicerLayerDM::MRML
77
DESCRIPTION
88
"vtkSlicerLayerDMModuleLogic"

LayerDM/MRML/CMakeLists.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@ set(classes
33
vtkMRMLLayerDMObjectEventObserver
44
vtkMRMLLayerDMWidgetEventTranslationNode
55
vtkMRMLLayerDMSelectionObserver
6+
vtkMRMLLayerDMObjectEventObserverScripted
7+
vtkMRMLLayerDMPythonUtil
68
)
79

8-
if (VTK_WRAP_PYTHON)
9-
list(APPEND classes
10-
vtkMRMLLayerDMObjectEventObserverScripted
11-
vtkMRMLLayerDMPythonUtil
12-
)
13-
endif ()
14-
15-
16-
vtk_module_add_module(VTK::SlicerLayerDMModuleMRML
10+
vtk_module_add_module(SlicerLayerDM::MRML
1711
EXPORT_MACRO_PREFIX VTK_SLICER_LAYERDM_MODULE_MRML
1812
CLASSES ${classes}
1913
)

LayerDM/MRML/vtk.module

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
NAME
2-
VTK::SlicerLayerDMModuleMRML
2+
SlicerLayerDM::MRML
33
LIBRARY_NAME
44
vtkSlicerLayerDMModuleMRML
55
DEPENDS
6-
VTK::SlicerBaseLogic
7-
VTK::MRMLCore
6+
Slicer::BaseLogic
7+
Slicer::MRMLCore
88
DESCRIPTION
99
"vtkSlicerLayerDMModuleMRML"

LayerDM/MRMLDM/CMakeLists.txt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,10 @@ set(classes
88
vtkMRMLLayerDMPipelineI
99
vtkMRMLLayerDMPipelineManager
1010
vtkMRMLLayerDisplayableManager
11+
vtkMRMLLayerDMPipelineScriptedCreator
12+
vtkMRMLLayerDMScriptedPipelineBridge
1113
)
1214

13-
if (VTK_WRAP_PYTHON)
14-
list(APPEND classes
15-
vtkMRMLLayerDMPipelineScriptedCreator
16-
vtkMRMLLayerDMScriptedPipelineBridge
17-
)
18-
19-
add_subdirectory(Python)
20-
endif ()
21-
2215
# Handle factory registration
2316
set(factory_classes
2417
vtkMRMLLayerDisplayableManager
@@ -35,12 +28,14 @@ vtk_object_factory_configure(
3528
EXPORT_MACRO "")
3629

3730
# Module configuration
38-
vtk_module_add_module(VTK::SlicerLayerDMModuleMRMLDisplayableManager
31+
vtk_module_add_module(SlicerLayerDM::MRMLDisplayableManager
3932
EXPORT_MACRO_PREFIX VTK_SLICER_LAYERDM_MODULE_MRMLDISPLAYABLEMANAGER
4033
CLASSES ${classes}
4134
SOURCES ${vtk_object_factory_source}
4235
PRIVATE_HEADERS ${vtk_object_factory_header}
4336
)
4437

45-
vtk_module_definitions(VTK::SlicerLayerDMModuleMRMLDisplayableManager PRIVATE
38+
vtk_module_definitions(SlicerLayerDM::MRMLDisplayableManager PRIVATE
4639
"vtkSlicerLayerDMModuleMRMLDisplayableManager_AUTOINIT=1(vtkSlicerLayerDMModuleMRMLDisplayableManager)")
40+
41+
add_subdirectory(Python)

LayerDM/MRMLDM/vtk.module

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
NAME
2-
VTK::SlicerLayerDMModuleMRMLDisplayableManager
2+
SlicerLayerDM::MRMLDisplayableManager
33
LIBRARY_NAME
44
vtkSlicerLayerDMModuleMRMLDisplayableManager
55
IMPLEMENTABLE
66
DEPENDS
7-
VTK::MRMLDisplayableManager
8-
VTK::SlicerLayerDMModuleMRML
7+
Slicer::MRMLDisplayableManager
8+
SlicerLayerDM::MRML
99
DESCRIPTION
1010
"vtkSlicerLayerDMModuleMRMLDisplayableManager"

Python/slicer_layerdm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Entry point for slicer dummy package
2+
from slicer_layerdm import *

0 commit comments

Comments
 (0)