Do not build DRAWEXE.exe in static build. This would require installing a lot
of build dependencies. And we are not installing that executable anyway.
Do not declare functions with "dllimport" attribute when linking to static library.

diff -urN occt-V7_6_2/CMakeLists.txt.orig occt-V7_6_2/CMakeLists.txt
--- occt-V7_6_2/CMakeLists.txt.orig	2022-04-26 11:59:16.000000000 +0200
+++ occt-V7_6_2/CMakeLists.txt	2022-05-20 10:08:25.434683400 +0200
@@ -460,6 +460,10 @@ endforeach()
 
 # accumulate all used toolkits
 list (REMOVE_DUPLICATES BUILD_TOOLKITS)
+if (NOT BUILD_SHARED_LIBS)
+  list (REMOVE_ITEM BUILD_TOOLKITS "DRAWEXE")
+endif()
+
 set (RAW_BUILD_TOOLKITS)
 foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
   OCCT_TOOLKIT_FULL_DEP (${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS)
@@ -614,6 +618,9 @@ OCCT_IS_PRODUCT_REQUIRED (CSF_OpenVR CAN_USE_OPENVR)
 if (CAN_USE_OPENVR)
   if (USE_OPENVR)
     add_definitions (-DHAVE_OPENVR)
+    if (NOT BUILD_SHARED_LIBS)
+      add_definitions (-DOPENVR_BUILD_STATIC)
+    endif()
     OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/openvr")
   else()
     OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_OPENVR")
