Description: Fix compilation with vtk 5.10.1
Author: Mathieu Malaterre <malat@debian.org>
Bug-Debian: https://bugs.debian.org/798545
Forwarded: not-needed

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,12 +120,12 @@
   MESSAGE(FATAL_ERROR "error: mummy not found. mummy_EXECUTABLE='${mummy_EXECUTABLE}'")
 ENDIF(NOT mummy_EXECUTABLE)
 
-IF(NOT gccxml_EXECUTABLE)
-  FIND_PROGRAM(gccxml_EXECUTABLE gccxml)
-ENDIF(NOT gccxml_EXECUTABLE)
-IF(NOT gccxml_EXECUTABLE)
-  MESSAGE(FATAL_ERROR "error: gccxml not found. gccxml_EXECUTABLE='${gccxml_EXECUTABLE}'")
-ENDIF(NOT gccxml_EXECUTABLE)
+IF(NOT castxml_EXECUTABLE)
+  FIND_PROGRAM(castxml_EXECUTABLE castxml)
+ENDIF(NOT castxml_EXECUTABLE)
+IF(NOT castxml_EXECUTABLE)
+  MESSAGE(FATAL_ERROR "error: castxml not found. castxml_EXECUTABLE='${castxml_EXECUTABLE}'")
+ENDIF(NOT castxml_EXECUTABLE)
 
 
 INCLUDE_DIRECTORIES(${Mummy_INCLUDE_DIRS})
@@ -280,7 +280,7 @@
 MESSAGE(STATUS "AVDN_VTK_USE_SYSTEM_ZLIB='${AVDN_VTK_USE_SYSTEM_ZLIB}'")
 
 MESSAGE(STATUS "csc_EXECUTABLE='${csc_EXECUTABLE}'")
-MESSAGE(STATUS "gccxml_EXECUTABLE='${gccxml_EXECUTABLE}'")
+MESSAGE(STATUS "castxml_EXECUTABLE='${castxml_EXECUTABLE}'")
 MESSAGE(STATUS "mono_EXECUTABLE='${mono_EXECUTABLE}'")
 MESSAGE(STATUS "mummy_EXECUTABLE='${mummy_EXECUTABLE}'")
 
@@ -441,9 +441,9 @@
 
 # Compute
 #
-SET(gccxml_include_args "")
+SET(castxml_include_args "")
 FOREACH(dir ${Mummy_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS})
-  SET(gccxml_include_args ${gccxml_include_args} "-I${dir}")
+  SET(castxml_include_args ${castxml_include_args} "-I${dir}")
 ENDFOREACH(dir)
 
 SET(exe_dir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
@@ -452,7 +452,7 @@
 ENDIF(EXECUTABLE_OUTPUT_PATH)
 
 
-# Run gccxml/mummy on each wrapped class:
+# Run castxml/mummy on each wrapped class:
 #
 SET(WRAPPED_CLASS_TABLE "")
 SET(generated_files "")
@@ -528,14 +528,6 @@
 MESSAGE(STATUS "VTK_KITS_DIR='${VTK_KITS_DIR}'...")
 
 
-SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")
-IF(MSVC80)
-  SET(gccxml_compiler "msvc8")
-ENDIF(MSVC80)
-IF(MSVC90)
-  SET(gccxml_compiler "msvc9")
-ENDIF(MSVC90)
-MESSAGE(STATUS "gccxml_compiler='${gccxml_compiler}'...")
 
 
 FOREACH(kit ${kits})
@@ -605,17 +597,28 @@
 
         ADD_CUSTOM_COMMAND(
           OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
-          COMMAND ${gccxml_EXECUTABLE}
+          COMMAND ${castxml_EXECUTABLE}
           ARGS
-            -fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
-            -fxml-start=_cable_
-            ${gccxml_include_args} -DCABLE_CONFIGURATION
-            --gccxml-compiler ${gccxml_compiler}
+           --castxml-gccxml
+            -o ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
+            --castxml-start _cable_
+            ${castxml_include_args} -DCABLE_CONFIGURATION
             ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
+          # Remove the "Converter" and "Destructor" XML tags that are
+          # generated by "castxml" with a format that is different
+          # from that of "gccxml", and thus that are not properly
+          # understood by "mummy". Removing these tags does not seem
+          # to modify the output of "mummy".
+          COMMAND sed
+          ARGS
+            -i
+            "/^  <\\(Converter\\|Destructor\\) /d"
+            ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml
           DEPENDS
             ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
             ${header}
-            ${gccxml_EXECUTABLE}
+            ${castxml_EXECUTABLE}
+          VERBATIM
         )
 
 #
--- a/GenerateEventFragments.cmake
+++ b/GenerateEventFragments.cmake
@@ -109,6 +109,11 @@
   IF("${line}" STREQUAL "#define VTK_EVENT_TYPES \\E")
     SET(in_event_list 1)
   ENDIF()
+  # Sometime between 5.8 and 6.0, it changed to this line:
+  if("${line}" STREQUAL "#define vtkAllEventsMacro() \\E")
+    set(in_event_list 1)
+  endif()
+
 ENDFOREACH()
 
 # In addition to parsing the list, also add the two pre-defined ones that
--- a/MummySettings.xml.in
+++ b/MummySettings.xml.in
@@ -5,10 +5,13 @@
        that comes out of VTK's CMake info...) -->
 
   <Class name="vtkAbstractContextBufferId" wrappable="false"/>
+  <Class name="vtkAbstractElectronicData" wrappable="false"/>
   <Class name="vtkAMRBox" wrappable="false"/>
   <Class name="vtkArrayCoordinates" wrappable="false"/>
   <Class name="vtkArrayExtents" wrappable="false"/>
   <Class name="vtkArrayRange" wrappable="false"/>
+  <Class name="vtkAtom" wrappable="false"/>
+  <Class name="vtkBond" wrappable="false"/>
   <Class name="vtkBoundingBox" wrappable="false"/>
   <Class name="vtkCallbackCommand" wrappable="false"/>
   <Class name="vtkColor3ub" wrappable="false"/>
@@ -16,6 +19,7 @@
   <Class name="vtkContextKeyEvent" wrappable="false"/>
   <Class name="vtkContextMouseEvent" wrappable="false"/>
   <Class name="vtkContourRepresentationNode" wrappable="false"/>
+  <Class name="vtkDebugLeaksObserver" wrappable="false"/>
   <Class name="vtkEdgeType" wrappable="false"/>
   <Class name="vtkExodusIICacheKey" wrappable="false"/>
   <Class name="vtkImageComplex" wrappable="false"/>
@@ -46,6 +50,7 @@
   <Class name="vtkVector2f" wrappable="false"/>
   <Class name="vtkVector2i" wrappable="false"/>
   <Class name="vtkVector3d" wrappable="false"/>
+  <Class name="vtkVector3f" wrappable="false"/>
   <Class name="vtkVolumeRayCastDynamicInfo" wrappable="false"/>
   <Class name="vtkVolumeRayCastStaticInfo" wrappable="false"/>
 @AVDN_EXTRA_EXCLUDE_CLASSES_XML@
