0032315: Configuration, CMake - fix building Draw Harness plugins as static libraries
[occt.git] / src / DRAWEXE / DRAWEXE.cxx
index 782d490..4e3e7f4 100644 (file)
 #include <Draw.hxx>
 #include <DBRep.hxx>
 #include <DrawTrSurf.hxx>
+#include <Message.hxx>
+#include <Message_PrinterSystemLog.hxx>
+
+#ifdef OCCT_NO_PLUGINS
+  #include <BOPTest.hxx>
+  #include <DPrsStd.hxx>
+  #if defined(HAVE_OPENGL) || defined(HAVE_GLES2)
+  #include <OpenGlTest.hxx>
+  #endif
+  #include <TObjDRAW.hxx>
+  #include <ViewerTest.hxx>
+  #include <XSDRAWSTLVRML.hxx>
+  #include <XDEDRAW.hxx>
+#endif
 
 //=======================================================================
 //function : Draw_InitAppli
 
 void Draw_InitAppli (Draw_Interpretor& di)
 {
+#if defined(__EMSCRIPTEN__)
+  // open JavaScript console within the Browser to see this output
+  Handle(Message_PrinterSystemLog) aJSConsolePrinter = new Message_PrinterSystemLog ("DRAWEXE");
+  Message::DefaultMessenger()->AddPrinter (aJSConsolePrinter);
+#endif
+
   Draw::Commands (di);
   DBRep::BasicCommands (di);
   DrawTrSurf::BasicCommands (di);
+
+#ifdef OCCT_NO_PLUGINS
+  // load a couple of plugins
+  BOPTest::Factory (di);
+  DPrsStd::Factory (di);
+  XSDRAWSTLVRML::Factory (di);
+  XDEDRAW::Factory (di);
+  #if defined(HAVE_OPENGL) || defined(HAVE_GLES2)
+  ViewerTest::Factory (di);
+  OpenGlTest::Factory (di);
+  #endif
+  //TObjDRAW::Factory (di);
+  //QADraw::Factory (di);
+#endif
 }
 
 #include <Draw_Main.hxx>