]> OCCT Git - occt.git/commitdiff
0031582: Configuration, CMake - OCCT fails to build with VTK 9.0
authorkgv <kgv@opencascade.com>
Mon, 17 Aug 2020 09:58:31 +0000 (12:58 +0300)
committerbugmaster <bugmaster@opencascade.com>
Sat, 22 Aug 2020 09:13:11 +0000 (12:13 +0300)
Handle "VTK::" prefix instead of "vtk" used by previous VTK versions for targets.
Corrected unexpected location of endif() and broken indentation.
Obsolete $VTK_USE_FILE is no more included (basing on VTK version check).

Standard_WarningsDisable.hxx/Standard_WarningsRestore.hxx pair is now used to suppress VTK warnings instead of partial disabling.

13 files changed:
adm/cmake/occt_toolkit.cmake
adm/cmake/vtk.cmake
src/IVtkDraw/IVtkDraw.cxx
src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.cxx
src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.hxx
src/IVtkDraw/IVtkDraw_Interactor.cxx
src/IVtkDraw/IVtkDraw_Interactor.hxx
src/IVtkTools/IVtkTools_ShapeDataSource.hxx
src/IVtkTools/IVtkTools_ShapeObject.hxx
src/IVtkTools/IVtkTools_ShapePicker.hxx
src/IVtkTools/IVtkTools_SubPolyDataFilter.hxx
src/IVtkVTK/IVtkVTK_ShapeData.cxx
src/IVtkVTK/IVtkVTK_ShapeData.hxx

index 38c39ae0c1bfa65e70337e99b606351910f3a547..ca84f4c3fc5e86bdce92562a0c46f6abdaeb8e0a 100644 (file)
@@ -323,7 +323,7 @@ endif()
 
 # Update list of used VTK libraries if OpenGL2 Rendering BackEnd is used.
 # Add VTK_OPENGL2_BACKEND definition.
-if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
+if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2" OR IS_VTK_9XX)
   add_definitions(-DVTK_OPENGL2_BACKEND)
   foreach (VTK_EXCLUDE_LIBRARY vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL)
     list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "${VTK_EXCLUDE_LIBRARY}" IS_VTK_OPENGL_FOUND)
@@ -347,6 +347,9 @@ else()
 endif()
 
 if (BUILD_SHARED_LIBS)
+  if(IS_VTK_9XX)
+    string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
+  endif()
   target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
 endif()
 
index c5692fd60eac6a8df49409308221072cc6934427..a81cdf9bb2a095d539b0a5ce017333a831c504f2 100644 (file)
@@ -66,10 +66,15 @@ if (3RDPARTY_VTK_DIR AND EXISTS "${3RDPARTY_VTK_DIR}")
   set (ENV{VTK_DIR} ${CACHED_VTK_DIR})
 endif()
 
+unset (IS_VTK_9XX)
 if (VTK_FOUND)
-
-  # add compiler flags, preprocessor definitions, include and link dirs
-  include (${VTK_USE_FILE})
+  message ("VTK version (${VTK_VERSION})")
+  if(VTK_MAJOR_VERSION EQUAL 8 AND VTK_MINOR_VERSION GREATER 9 OR VTK_MAJOR_VERSION GREATER 8)
+    set (IS_VTK_9XX 1)
+  else()
+    # add compiler flags, preprocessor definitions, include and link dirs
+    include (${VTK_USE_FILE})
+  endif()
 
   if (VTK_LIBRARIES)
 
@@ -81,79 +86,83 @@ if (VTK_FOUND)
 #    endif()
 
     foreach (VTK_LIBRARY ${VTK_LIBRARIES})
-      string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY})
-      if (IS_VTK_LIBRARY AND TARGET ${VTK_LIBRARY})
-        # get paths from corresponding variables
-        if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
-          list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
+      if (IS_VTK_9XX)
+        string (REGEX MATCH "^VTK::" IS_VTK_LIBRARY ${VTK_LIBRARY})
+      else()
+        string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY})
+      endif()
+      if (NOT IS_VTK_LIBRARY OR NOT TARGET ${VTK_LIBRARY})
+        continue()
+      endif()
+
+      # get paths from corresponding variables
+      if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
+        list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
+      endif()
+
+      if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
+        list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
+      endif()
+
+      if (${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
+        list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
+        if (NOT WIN32)
+          list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
         endif()
+      endif()
 
-          if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
-            list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
+      # get paths from corresponding properties
+      get_target_property (TARGET_VTK_IMPORT_CONFS ${VTK_LIBRARY} IMPORTED_CONFIGURATIONS)
+      if (TARGET_VTK_IMPORT_CONFS)
+        list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
+
+        # todo: choose configuration in connection with the build type
+        #if (CMAKE_BUILD_TYPE)
+        #  foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
+        #  endforeach()
+        #endif()
+
+        # Work-around against link failure in case if VTK contains dependency
+        # on DirectX: its run-time is always present on Windows, but SDK can
+        # be absent on current workstation, while not actually needed for
+        # OCCT linking.
+        # VTK 6.1 for VC 10
+        get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF})
+        if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
+          string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
+          if (HARDCODED_D3D9_LIB)
+            message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
+
+            list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
+            set_target_properties (${VTK_LIBRARY} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF} "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
           endif()
-
-          if (${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
-            list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
-            if (NOT WIN32)
-              list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
-            endif()
+        endif()
+        # VTK 6.1 for VC 12, 14
+        get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} INTERFACE_LINK_LIBRARIES)
+        if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
+          string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
+          if (HARDCODED_D3D9_LIB)
+            message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
+
+            list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
+            set_target_properties (${VTK_LIBRARY} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
           endif()
+        endif()
 
-          # get paths from corresponding properties
-          get_target_property (TARGET_VTK_IMPORT_CONFS ${VTK_LIBRARY} IMPORTED_CONFIGURATIONS)
-
-          if (TARGET_VTK_IMPORT_CONFS)
-            list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
-
-            # todo: choose configuration in connection with the build type
-            #if (CMAKE_BUILD_TYPE)
-            #  foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
-            #  endforeach()
-            #endif()
-
-            # Work-around against link failure in case if VTK contains dependency
-            # on DirectX: its run-time is always present on Windows, but SDK can
-            # be absent on current workstation, while not actually needed for 
-            # OCCT linking.
-            # VTK 6.1 for VC 10
-            get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF})
-            if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
-              string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
-              if (HARDCODED_D3D9_LIB)
-                message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
-
-                list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
-                set_target_properties (${VTK_LIBRARY} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF} "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
-              endif()
-            endif()
-            # VTK 6.1 for VC 12, 14
-            get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} INTERFACE_LINK_LIBRARIES)
-            if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
-              string (REGEX MATCH "[^;]*d3d[0-9]+[.]lib" HARDCODED_D3D9_LIB "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
-              if (HARDCODED_D3D9_LIB)
-                message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from imported dependencies of ${VTK_LIBRARY}")
-
-                list (REMOVE_ITEM TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${HARDCODED_D3D9_LIB})
-                set_target_properties (${VTK_LIBRARY} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
-              endif()
-            endif()
-
-            get_target_property (TARGET_PROPERTY_IMP_PATH ${VTK_LIBRARY} IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
-            if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}")
-              get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
-              list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
-            endif()
-
-            get_target_property (TARGET_PROPERTY_LOCATION_PATH ${VTK_LIBRARY} IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
-            if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}")
-              get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
-
-              if (WIN32)
-                list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
-              else()
-                list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
-              endif()
-            endif()
+        get_target_property (TARGET_PROPERTY_IMP_PATH ${VTK_LIBRARY} IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
+        if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}")
+          get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
+          list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
+        endif()
+
+        get_target_property (TARGET_PROPERTY_LOCATION_PATH ${VTK_LIBRARY} IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
+        if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}")
+          get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
+
+          if (WIN32)
+            list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
+          else()
+            list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
           endif()
         endif()
       endif()
@@ -187,6 +196,7 @@ if (VTK_FOUND)
       endif()
     endif()
 #  endif()
+endif()
 
 if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
   list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIR})
index 747a7657f29e353db0cb67d5dd129e02fbf2b38a..93d4a2fd1a67bef4cc32b401b51b35d31d71842d 100644 (file)
 #include <IVtkDraw_Interactor.hxx>
 
 // prevent disabling some MSVC warning messages by VTK headers 
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable: 4244)
-#endif
+#include <Standard_WarningsDisable.hxx>
 #include <vtkAlgorithmOutput.h>
 #include <vtkAppendPolyData.h>
 #include <vtkBMPWriter.h>
@@ -88,9 +85,7 @@
   #include <vtkXOpenGLRenderWindow.h>
   #include <tk.h>
 #endif
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
+#include <Standard_WarningsRestore.hxx>
 
 #if (VTK_MAJOR_VERSION > 8) || (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1)
   #define HAVE_VTK_SRGB
index d20883b00823eefd95da77269a143774c8a44033..07328f16fdab4fb7cc1e58ed718b1df9a119a061 100644 (file)
@@ -16,9 +16,7 @@
 #include <IVtkDraw_HighlightAndSelectionPipeline.hxx>
 
 // prevent disabling some MSVC warning messages by VTK headers 
-#ifdef _MSC_VER
-#pragma warning(push)
-#endif
+#include <Standard_WarningsDisable.hxx>
 #include <vtkRenderer.h>
 #include <vtkActor.h>
 #include <vtkPolyDataMapper.h>
 #include <vtkAppendPolyData.h>
 #include <vtkProperty.h>
 #include <vtkRenderWindow.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
+#include <Standard_WarningsRestore.hxx>
 
 #include <IVtkOCC_Shape.hxx>
 #include <IVtkTools_DisplayModeFilter.hxx>
 #include <IVtkTools_ShapeDataSource.hxx>
 #include <IVtkTools_ShapeObject.hxx>
 
-
 IMPLEMENT_STANDARD_RTTIEXT(IVtkDraw_HighlightAndSelectionPipeline,Standard_Transient)
 
 //===========================================================
index a8e8574cf0b4a607d0043afed30dc66604ddeac2..9e8a4e028a5f6d19182d96f18dd449acdbab6380 100644 (file)
 #include <TopoDS_Shape.hxx>
 
 // prevent disabling some MSVC warning messages by VTK headers 
-#ifdef _MSC_VER
-#pragma warning(push)
-#endif
+#include <Standard_WarningsDisable.hxx>
 #include <vtkActor.h>
 #include <vtkPolyData.h>
 #include <vtkPolyDataMapper.h>
 #include <vtkRenderer.h>
 #include <vtkSmartPointer.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
+#include <Standard_WarningsRestore.hxx>
 
 #include <IVtk_Types.hxx>
 #include <IVtkTools_DisplayModeFilter.hxx>
index 44efe5e96436d45ff55d74489d41dca13708521f..f9f68c37b60ab7a68e492780e96473dd3aa35641 100644 (file)
@@ -14,9 +14,7 @@
 // commercial license or contractual agreement.
 
 // prevent disabling some MSVC warning messages by VTK headers 
-#ifdef _MSC_VER
-#pragma warning(push)
-#endif
+#include <Standard_WarningsDisable.hxx>
 #ifdef _WIN32
 #include <vtkWin32RenderWindowInteractor.h>
 #include <vtkWin32OpenGLRenderWindow.h>
 #include <vtkCommand.h>
 #include <vtkObjectFactory.h>
 #include <vtkSmartPointer.h>
+#include <Standard_WarningsRestore.hxx>
 
 #include <IVtkDraw_Interactor.hxx>
 
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
 #include <IVtkTools_ShapePicker.hxx>
 #include <IVtkTools_SubPolyDataFilter.hxx>
 #include <IVtkTools_DisplayModeFilter.hxx>
index 2bfe759781fd5a86ddb70810cc10bd6f5914018b..41c92fb0fc7e8e8d96e6370c975dca126147de6e 100644 (file)
 #endif
 
 // prevent disabling some MSVC warning messages by VTK headers 
-#ifdef _MSC_VER
-#pragma warning(push)
-#endif
+#include <Standard_WarningsDisable.hxx>
 #include <vtkRenderWindowInteractor.h>
 #include <vtkSmartPointer.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
+#include <Standard_WarningsRestore.hxx>
 
 #include <IVtkTools_ShapePicker.hxx>
 #include <IVtkDraw_HighlightAndSelectionPipeline.hxx>
index c1a6ec5dc71847f3b74c92bd743d218f4085227b..32ec632a2f90a6dabc8aca7f640f8bd35964c09a 100644 (file)
 #include <IVtkTools.hxx>
 #include <IVtkOCC_Shape.hxx>
 #include <IVtkVTK_ShapeData.hxx>
+
+#include <Standard_WarningsDisable.hxx>
 #include <vtkPolyDataAlgorithm.h>
+#include <Standard_WarningsRestore.hxx>
 
 class vtkIdTypeArray;
 class vtkPolyData;
index 4624f84f97a667685932a9251e8ade6055fe5d6d..6fff02468f310062120028bef0f92015b8ac1cbc 100644 (file)
 #include <IVtkOCC_Shape.hxx>
 
 // prevent disabling some MSVC warning messages by VTK headers 
-#ifdef _MSC_VER
-#pragma warning(push)
-#endif
+#include <Standard_WarningsDisable.hxx>
 #include <vtkDataObject.h>
 #include <vtkSetGet.h>
 #include <vtkWeakPointer.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
+#include <Standard_WarningsRestore.hxx>
 
 class vtkActor;
 class vtkDataSet;
index bac70741431918fac0d1b34ee630d7f539eabaf7..e7e0c1cee2bc9b78f6a4f99f12be31abf0c3c4dd 100644 (file)
 #include <IVtkOCC_ShapePickerAlgo.hxx>
 
 // prevent disabling some MSVC warning messages by VTK headers 
-#ifdef _MSC_VER
-#pragma warning(push)
-#endif
+#include <Standard_WarningsDisable.hxx>
 #include <vtkAbstractPropPicker.h>
 #include <vtkSmartPointer.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
+#include <Standard_WarningsRestore.hxx>
 
 class vtkRenderer;
 class vtkActorCollection;
index 052a9a1750c8f246576ca3d96ead1cfd273c58d6..e263a020f5c0c81212b8934f3b9b0b850c6080d9 100644 (file)
@@ -18,7 +18,9 @@
 
 #include <IVtkTools.hxx>
 
-#include "vtkPolyDataAlgorithm.h"
+#include <Standard_WarningsDisable.hxx>
+#include <vtkPolyDataAlgorithm.h>
+#include <Standard_WarningsRestore.hxx>
 
 #ifdef _MSC_VER
 #pragma warning(push)
index 97b10daa2b3ec7013f95633c1d2d072d115a765c..e647fd8df8a7f4f67f130bd5a2036cfcd4adbbcf 100644 (file)
 #include <IVtkVTK_ShapeData.hxx>
 
 // prevent disabling some MSVC warning messages by VTK headers 
-#ifdef _MSC_VER
-#pragma warning(push)
-#endif
+#include <Standard_WarningsDisable.hxx>
 #include <vtkCellData.h>
 #include <vtkDoubleArray.h>
 #include <vtkIdList.h>
 #include <vtkPoints.h>
 #include <vtkPolyData.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
+#include <Standard_WarningsRestore.hxx>
 
 IMPLEMENT_STANDARD_RTTIEXT(IVtkVTK_ShapeData,IVtk_IShapeData)
 
index 04ceac3371feda98d60c986b5c510a65e55f2026..0fda1748ab206fc600cedd931ea18f2cf476caa1 100644 (file)
 #include <IVtk_IShapeData.hxx>
 
 // prevent disabling some MSVC warning messages by VTK headers 
-#ifdef _MSC_VER
-#pragma warning(push)
-#endif
+#include <Standard_WarningsDisable.hxx>
 #include <vtkPolyData.h>
 #include <vtkSmartPointer.h>
 #include <vtkIdTypeArray.h>
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
+#include <Standard_WarningsRestore.hxx>
 
 class vtkIdTypeArray;