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.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -413,6 +413,10 @@
 
 # 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)
 set (OCCT_FULL_LIST_OF_INCLUDES)
 foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS})
@@ -570,6 +570,9 @@
 OCCT_IS_PRODUCT_REQUIRED (CSF_OpenVR CAN_USE_OPENVR)
 if (CAN_USE_OPENVR AND USE_OPENVR)
   add_definitions (-DHAVE_OPENVR)
+  if (NOT BUILD_SHARED_LIBS)
+    add_definitions (-DOPENVR_BUILD_STATIC)
+  endif()
   OCCT_ADD_VCPKG_FEATURE ("openvr")
   list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/openvr")
 elseif (NOT CAN_USE_OPENVR)
