]> OCCT Git - occt.git/commitdiff
Configuration - Restoring VTK toolkit processing #99
authordpasukhi <dpasukhi@opencascade.com>
Sat, 12 Oct 2024 18:15:44 +0000 (18:15 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Sat, 12 Oct 2024 19:44:14 +0000 (19:44 +0000)
Migration to PCH breaks some VTK search functionality.
Fixed non-unique package name caching

adm/cmake/occt_macros.cmake
adm/cmake/occt_toolkit.cmake
src/IVtk/IVtk_Types.hxx
src/IVtkDraw/IVtkDraw.cxx
src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.cxx
src/IVtkDraw/IVtkDraw_Interactor.hxx
src/IVtkTools/IVtkTools.hxx

index 50f139ea5de05769e77e1a4c1dd5d4125b91b5a6..5b423275add01409c71302167af4427f8479f365 100644 (file)
@@ -271,9 +271,11 @@ function(EXTRACT_TOOLKIT_EXTERNLIB RELATIVE_PATH OCCT_TOOLKIT RESULT_LIBS)
 endfunction()
 
 function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_INCLUDE_FOLDER)
+  # package name is not unique, it can be reuse in tools and src,
+  # use extra parameter as relative path to distinguish between them
   set (OCCT_PACKAGE_FILES "")
-  get_property(OCCT_PACKAGE_FILES GLOBAL PROPERTY OCCT_PACKAGE_${OCCT_PACKAGE}_FILES)
-  get_property(OCCT_PACKAGE_INCLUDE_DIR GLOBAL PROPERTY OCCT_PACKAGE_${OCCT_PACKAGE}_INCLUDE_DIR)
+  get_property(OCCT_PACKAGE_FILES GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_FILES)
+  get_property(OCCT_PACKAGE_INCLUDE_DIR GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_INCLUDE_DIR)
   if (OCCT_PACKAGE_FILES)
     set (${RESULT_FILES} ${OCCT_PACKAGE_FILES} PARENT_SCOPE)
     set (${RESULT_INCLUDE_FOLDER} ${OCCT_PACKAGE_INCLUDE_DIR} PARENT_SCOPE)
@@ -310,8 +312,8 @@ function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_I
 
   set (${RESULT_FILES} ${FILE_PATH_LIST} PARENT_SCOPE)
   set (${RESULT_INCLUDE_FOLDER} ${OCCT_PACKAGE_INCLUDE_DIR} PARENT_SCOPE)
-  set_property(GLOBAL PROPERTY OCCT_PACKAGE_${OCCT_PACKAGE}_FILES "${FILE_PATH_LIST}")
-  set_property(GLOBAL PROPERTY OCCT_PACKAGE_${OCCT_PACKAGE}_INCLUDE_DIR "${OCCT_PACKAGE_INCLUDE_DIR}")
+  set_property(GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_FILES "${FILE_PATH_LIST}")
+  set_property(GLOBAL PROPERTY OCCT_PACKAGE_${RELATIVE_PATH}_${OCCT_PACKAGE}_INCLUDE_DIR "${OCCT_PACKAGE_INCLUDE_DIR}")
 endfunction()
 
 function(EXCTRACT_TOOLKIT_DEPS RELATIVE_PATH OCCT_TOOLKIT RESULT_TKS_AS_DEPS RESULT_INCLUDE_FOLDERS)
index 3dfd0b66619e50ee42157e589b8e77cd6aeb86cf..60032361e141cb5c31c00eb12a7e73e85a2ac2bb 100644 (file)
@@ -229,8 +229,11 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
   string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
   string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
 
-  if (NOT "${VTK_FOUND}" STREQUAL "" AND BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
-    OCCT_INSTALL_VTK(${USED_ITEM})
+  if (NOT "${VTK_FOUND}" STREQUAL "")
+    list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
+    if (BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
+      OCCT_INSTALL_VTK(${USED_ITEM})
+    endif()
     continue()
   endif()
   # Search for 3rd-party libraries as a dependency
index b1e00f5300fcf01fb84999336f7a7a2b8cf5a414..5c7acab9ca0ac3ac82b6e25016a406dec0a83dab 100644 (file)
@@ -24,6 +24,8 @@
 #include <Standard_Integer.hxx>
 #include <vtkType.h>
 
+#include <limits>
+
 #ifdef VTK_USE_64BIT_IDS
 #if defined(_WIN32) && !defined(_WIN64)
 #error "64-bit VTK library can not be linked for 32-bit target platform"
index aedfc709a36fb4dd7aade7b893a6d18077036a38..0f995d79b2a59807e35922ce4faac7ee6bab01f0 100644 (file)
@@ -77,7 +77,6 @@
 #include <vtkWindowToImageFilter.h>
 #ifndef _WIN32
   #include <X11/X.h>
-  #include <X11/Shell.h>
   #include <X11/Xlib.h>
   #include <X11/Xutil.h>
   #include <GL/glx.h>
index b6fa1399aa7235647aceff17e79389c3cddd700e..220678b90ec524c6f2e274ae636a31bd4f9038f0 100644 (file)
@@ -13,6 +13,9 @@
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
+// Workaround for PCH
+#include <limits>
+
 #include <IVtkDraw_HighlightAndSelectionPipeline.hxx>
 
 // prevent disabling some MSVC warning messages by VTK headers 
index 41c92fb0fc7e8e8d96e6370c975dca126147de6e..547e877e3c7b59e4edf0aa536d588d62e9bd2ce4 100644 (file)
@@ -25,7 +25,6 @@
 #else
 #include <X11/X.h>
 #include <X11/Xlib.h>
-#include <X11/Shell.h>
 #include <X11/Xutil.h>
 #include <tk.h>
 #endif
index f7263adf1fe908d7022fd406d79632837bfce217..b2e64996c0dae31ed564cc916c5b29698833bd08 100644 (file)
@@ -19,6 +19,8 @@
 #include <IVtk_Types.hxx>
 #include <vtkSmartPointer.h>
 
+#include <limits>
+
 class vtkLookupTable;
 class vtkMapper;