Salome HOME
Fix for '17915 [CEA 17912] CurvePlot breaks GUI build on Windows' issue.
authorrnv <rnv@opencascade.com>
Wed, 30 Oct 2019 14:52:49 +0000 (17:52 +0300)
committerrnv <rnv@opencascade.com>
Wed, 30 Oct 2019 14:52:49 +0000 (17:52 +0300)
tools/CMakeLists.txt
tools/CurvePlot/src/cpp/CMakeLists.txt
tools/CurvePlot/src/cpp/CurvePlot.hxx
tools/CurvePlot/src/cpp/test/CMakeLists.txt

index a8fd757470e60b25f2482649c46ec4de791fa41d..433f80686445444a81e5134e9c16a6e13c7d1aef 100644 (file)
@@ -18,7 +18,6 @@
 #
 
 ADD_SUBDIRECTORY(dlgfactory)
-ADD_SUBDIRECTORY(CurvePlot)
 
 ##
 # Python-based packages, part 1 (generic)
@@ -32,6 +31,9 @@ IF(SALOME_USE_PYCONSOLE)
   SET(PYCONSOLE_INSTALL_RES "${SALOME_GUI_INSTALL_RES_DATA}" CACHE PATH "")
      
   ADD_SUBDIRECTORY(../tools/PyConsole) # will bring in PyInterp automatically
+
+  ADD_SUBDIRECTORY(CurvePlot)
+
 ENDIF(SALOME_USE_PYCONSOLE)
 
 IF(SALOME_USE_PYVIEWER)
index e35af2def42e182f45a099bc4b538e8944b007ce..3f701ebc0ebb4b7b61dd4dec7aad03b6f9517945 100644 (file)
@@ -34,6 +34,10 @@ ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
 # libraries to link to
 SET(_link_LIBRARIES ${PYTHON_LIBRARIES} ${GUI_PyInterp})
 
+IF(TARGET PyInterp)
+  SET(_link_LIBRARIES ${_link_LIBRARIES} PyInterp)
+ENDIF()
+
 # --- headers ---
 
 # header files / no moc processing
index 92b86802b527de320b683e3095eb4d96d7a6cc43..67c000a4e39b1c1ba8847bc69ae96b60a0055a31 100644 (file)
 #ifndef SRC_CPP_CURVEPLOT_HXX_
 #define SRC_CPP_CURVEPLOT_HXX_
 
+#ifdef WIN32
+#  if defined CURVEPLOT_EXPORTS || defined CurvePlot_EXPORTS
+#    define CURVEPLOT_EXPORT __declspec(dllexport)
+#  else
+#    define CURVEPLOT_EXPORT __declspec(dllimport)
+#  endif
+#else   // WIN32
+#  define CURVEPLOT_EXPORT
+#endif  // WIN32
+
+
 #include <string>
 #include <vector>
 
@@ -32,9 +43,9 @@ namespace CURVEPLOT
   /**
    * This function should be called before doing anything in the CURVEPLOT namespace.
    */
-  void* InitializeCurvePlot();
+  CURVEPLOT_EXPORT void* InitializeCurvePlot();
 
-  class ColumnVector
+  class CURVEPLOT_EXPORT ColumnVector
   {
   public:
     friend class CurvePlot;
@@ -75,7 +86,7 @@ namespace CURVEPLOT
   /**
    * C++ wrapping of the public API exposed in the Python package curveplot. See doc there.
    */
-  class CurvePlot
+  class CURVEPLOT_EXPORT CurvePlot
   {
   public:
     static PlotID AddCurve(const ColumnVector & x, const ColumnVector & y,
index 77d01edb7e09774d5fc870928483b4b192cb686a..50e6ef11a2aa8893f18e94fd13cec975fc40b7a5 100644 (file)
@@ -31,6 +31,11 @@ ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${QT_DEFINITIONS})
 # libraries to link to
 SET(_link_LIBRARIES ${PYTHON_LIBRARIES} ${GUI_PyInterp} ${QT_LIBRARIES} CurvePlot)
 
+IF(TARGET PyInterp)
+  SET(_link_LIBRARIES ${_link_LIBRARIES} PyInterp)
+ENDIF()
+
+
 # --- headers ---
 
 SET(_moc_HEADERS