1
- itk_wrap_class("itk:: CudaImage" POINTER_WITH_CONST_POINTER )
1
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ CudaImage.i.init" "${CMAKE_CURRENT_BINARY_DIR}/CudaImage.i" @ONLY )
2
2
3
+ itk_wrap_class("itk::CudaImage" POINTER_WITH_CONST_POINTER)
3
4
UNIQUE(types "UC;UL;${ITKM_IT};${WRAP_ITK_SCALAR}")
4
- foreach(d ${ITK_WRAP_IMAGE_DIMS})
5
- foreach(t ${types})
5
+ foreach(t ${types})
6
+ set(PixelType ${t})
7
+ foreach(d ${ITK_WRAP_IMAGE_DIMS})
6
8
itk_wrap_template("${t}${d}" "${ITKT_${t}}, ${d}")
9
+ set(CudaImageTypes ${t}${d})
10
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CudaImage.i.in ${CMAKE_CURRENT_BINARY_DIR}/CudaImage.i.temp @ONLY)
11
+ file(READ ${CMAKE_CURRENT_BINARY_DIR}/CudaImage.i.temp CudaImageInterfaceTemp)
12
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CudaImage.i ${CudaImageInterfaceTemp})
7
13
endforeach()
8
14
endforeach()
9
15
@@ -17,3 +23,21 @@ itk_wrap_class("itk::CudaImage" POINTER_WITH_CONST_POINTER)
17
23
endforeach()
18
24
19
25
itk_end_wrap_class()
26
+
27
+ # Add library files to be included at a submodule level and copy them into
28
+ # ITK's wrapping typedef directory.
29
+ # Another approach is to add CudaImage.i to the WRAPPER_SWIG_LIBRARY_FILES list
30
+ # but then the %pythoncode from CudaImage.i.init gets only included in
31
+ # itkCudaDataManagerPython.py even if the WRAPPER_SUBMODULE_ORDER is set.
32
+ # Prefer using ITK_WRAP_PYTHON_SWIG_EXT to make sure the block is included in
33
+ # the right file exclusively.
34
+ set(ITK_WRAP_PYTHON_SWIG_EXT
35
+ "%include CudaImage.i\n${ITK_WRAP_PYTHON_SWIG_EXT}")
36
+
37
+ file(COPY "${CMAKE_CURRENT_BINARY_DIR}/CudaImage.i"
38
+ DESTINATION "${WRAPPER_MASTER_INDEX_OUTPUT_DIR}")
39
+
40
+ # Make sure to rebuild the python file when CudaImage.i is modified.
41
+ # Touching CudaImage.i directly does not force a rebuild because it is just
42
+ # appended to the ITK_WRAP_PYTHON_SWIG_EXT variable
43
+ file(TOUCH ${WRAPPER_MASTER_INDEX_OUTPUT_DIR}/itkCudaImage.i)
0 commit comments