]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Detection of OpenGL is mandatory if OCC, VTK or GLviewer support is switched ON ...
authorvsr <vsr@opencascade.com>
Tue, 16 Jun 2015 08:43:11 +0000 (11:43 +0300)
committervsr <vsr@opencascade.com>
Tue, 16 Jun 2015 08:44:59 +0000 (11:44 +0300)
CMakeLists.txt
src/CMakeLists.txt
src/OCCViewer/CMakeLists.txt
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/SVTK/CMakeLists.txt
src/SVTK/SVTK_ViewWindow.cxx

index a0fbbaadea1ad929f81dbce9d1de89e84372c466..2929ce0dc7c539038a42b0dc3c444cb088976008 100755 (executable)
@@ -133,29 +133,33 @@ IF(SALOME_GUI_USE_OBSERVERS)
   ADD_DEFINITIONS(-DWITH_SALOMEDS_OBSERVER)
 ENDIF()
 
+# Single-study GUI
 IF(SALOME_USE_SINGLE_DESKTOP)
   ADD_DEFINITIONS(-DSINGLE_DESKTOP)
 ENDIF()
 
 # OCCT
 FIND_PACKAGE(SalomeCAS REQUIRED)
-IF(NOT SALOME_USE_OCCVIEWER)
-  ADD_DEFINITIONS("-DDISABLE_OCCVIEWER")
+
+# OpenGL
+IF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER)
+  FIND_PACKAGE(SalomeOpenGL REQUIRED)
 ENDIF()
 
 # Qt4
 FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtWebKit QtOpenGL)
 INCLUDE(${QT_USE_FILE})
 
+# PyQt4
 FIND_PACKAGE(SalomePyQt4 REQUIRED)
 
 # Optional prerequisites for GUI
-IF(SALOME_USE_GLVIEWER)
-  FIND_PACKAGE(SalomeOpenGL)
-  SALOME_LOG_OPTIONAL_PACKAGE(OpenGL SALOME_USE_GLVIEWER) 
-ELSE()
+IF(NOT SALOME_USE_GLVIEWER)
   ADD_DEFINITIONS("-DDISABLE_GLVIEWER")
 ENDIF()
+IF(NOT SALOME_USE_OCCVIEWER)
+  ADD_DEFINITIONS("-DDISABLE_OCCVIEWER")
+ENDIF()
 IF(SALOME_USE_VTKVIEWER)
   # Required components are listed in the FindSalomeVTK.cmake file: 
   FIND_PACKAGE(SalomeVTK) 
@@ -175,15 +179,12 @@ IF (SALOME_USE_PVVIEWER)
 ELSE()
   ADD_DEFINITIONS("-DDISABLE_PVVIEWER")
 ENDIF()
-
 IF (NOT SALOME_USE_GRAPHICSVIEW)
   ADD_DEFINITIONS("-DDISABLE_GRAPHICSVIEW")
 ENDIF()
-
 IF (NOT SALOME_USE_PYVIEWER)
   ADD_DEFINITIONS("-DDISABLE_PYVIEWER")
 ENDIF()
-
 IF(SALOME_USE_PYCONSOLE)
   # Build with obsolete Python module's methods
   ADD_DEFINITIONS(-DCALL_OLD_METHODS)
@@ -282,6 +283,11 @@ SET(_${PROJECT_NAME}_exposed_targets
     ImageComposer
 )
 
+IF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER)
+  LIST(APPEND _${PROJECT_NAME}_exposed_targets 
+       OpenGLUtils)
+ENDIF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER)
+
 # SALOME object specific targets:
 IF(SALOME_USE_SALOMEOBJECT)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
@@ -291,7 +297,7 @@ ENDIF(SALOME_USE_SALOMEOBJECT)
 # GL specific targets:
 IF(SALOME_USE_GLVIEWER)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
-       OpenGLUtils GLViewer)
+       GLViewer)
 ENDIF(SALOME_USE_GLVIEWER)
 
 # VTK specific targets:
index b1baf45763ba62ab7fc21400e5b77d34e216d5ee..86c9ce7b692c37ef2b9a1eedb2e4f1bc8bf589a4 100755 (executable)
 ##
 # Common packages
 ##
-SET(SUBDIRS_COMMON
-  CASCatch Qtx HelpBrowser Style DDS QDS ObjBrowser SUIT SUITApp STD CAF
-  CAM LogWindow Prs Event ViewerData ViewerTools ImageComposer GUI_PY
-)
+ADD_SUBDIRECTORY(CASCatch)
+ADD_SUBDIRECTORY(Qtx)
+ADD_SUBDIRECTORY(HelpBrowser)
+ADD_SUBDIRECTORY(Style)
+ADD_SUBDIRECTORY(DDS)
+ADD_SUBDIRECTORY(QDS)
+ADD_SUBDIRECTORY(ObjBrowser)
+ADD_SUBDIRECTORY(SUIT)
+ADD_SUBDIRECTORY(SUITApp)
+ADD_SUBDIRECTORY(STD)
+ADD_SUBDIRECTORY(CAF)
+ADD_SUBDIRECTORY(CAM)
+ADD_SUBDIRECTORY(LogWindow)
+ADD_SUBDIRECTORY(Prs)
+ADD_SUBDIRECTORY(Event)
+ADD_SUBDIRECTORY(ViewerData)
+ADD_SUBDIRECTORY(ViewerTools)
+ADD_SUBDIRECTORY(ImageComposer)
+ADD_SUBDIRECTORY(GUI_PY)
 
 ##
 # SALOME object
 ##
 IF(SALOME_USE_SALOMEOBJECT)
-  SET(SUBDIRS_OBJECT OBJECT)
+  ADD_SUBDIRECTORY(OBJECT)
 ENDIF(SALOME_USE_SALOMEOBJECT)
 
+##
+# OpenGL utils
+##
+IF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER)
+  ADD_SUBDIRECTORY(OpenGLUtils)
+ENDIF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER)
+
 ##
 # GL viewer
 ##
 IF(SALOME_USE_GLVIEWER)
-  SET(SUBDIRS_GLVIEWER OpenGLUtils GLViewer)
+  ADD_SUBDIRECTORY(GLViewer)
 ENDIF(SALOME_USE_GLVIEWER)
 
 ##
 # VTK viewer
 ##
 IF(SALOME_USE_VTKVIEWER)
-  SET(SUBDIRS_VTKVIEWER VTKViewer)
-
+  ADD_SUBDIRECTORY(VTKViewer)
   IF(SALOME_USE_SALOMEOBJECT)
-    LIST(APPEND SUBDIRS_VTKVIEWER SVTK)
+    ADD_SUBDIRECTORY(SVTK)
   ENDIF(SALOME_USE_SALOMEOBJECT)
 ENDIF(SALOME_USE_VTKVIEWER)
 
@@ -54,10 +75,9 @@ ENDIF(SALOME_USE_VTKVIEWER)
 # OCC viewer
 ##
 IF(SALOME_USE_OCCVIEWER)
-  SET(SUBDIRS_OCCVIEWER OCCViewer)
-  
+  ADD_SUBDIRECTORY(OCCViewer)
   IF(SALOME_USE_SALOMEOBJECT)
-    LIST(APPEND SUBDIRS_OCCVIEWER SOCC)
+    ADD_SUBDIRECTORY(SOCC)
   ENDIF(SALOME_USE_SALOMEOBJECT)
 ENDIF(SALOME_USE_OCCVIEWER)
 
@@ -65,10 +85,9 @@ ENDIF(SALOME_USE_OCCVIEWER)
 # Plot2d viewer
 ##
 IF(SALOME_USE_PLOT2DVIEWER)
-  SET(SUBDIRS_PLOT2DVIEWER Plot2d)
-
+  ADD_SUBDIRECTORY(Plot2d)
   IF(SALOME_USE_SALOMEOBJECT)
-    LIST(APPEND SUBDIRS_PLOT2DVIEWER SPlot2d)
+    ADD_SUBDIRECTORY(SPlot2d)
   ENDIF(SALOME_USE_SALOMEOBJECT)
 ENDIF(SALOME_USE_PLOT2DVIEWER)
 
@@ -76,72 +95,63 @@ ENDIF(SALOME_USE_PLOT2DVIEWER)
 # Qx scene viewer
 ##
 IF(SALOME_USE_QXGRAPHVIEWER)
-  SET(SUBDIRS_QXGRAPHVIEWER QxScene)
+  ADD_SUBDIRECTORY(QxScene)
 ENDIF(SALOME_USE_QXGRAPHVIEWER)
 
 # Graphics viewer
 ##
 IF(SALOME_USE_GRAPHICSVIEW)
-  SET(SUBDIRS_GRAPHICSVIEW GraphicsView)
+  ADD_SUBDIRECTORY(GraphicsView)
 ENDIF(SALOME_USE_GRAPHICSVIEW)
 
 # ParaView Viewer
 IF(SALOME_USE_PVVIEWER)
-  SET(SUBDIRS_PVVIEWER PVViewer)
+  ADD_SUBDIRECTORY(PVViewer)
 ENDIF()
 
 ##
 # Python Viewer
 ##
 IF(SALOME_USE_PYVIEWER)
-  SET(SUBDIRS_PYVIEWER PyEditor PyViewer)
+  ADD_SUBDIRECTORY(PyEditor)
+  ADD_SUBDIRECTORY(PyViewer)
 ENDIF(SALOME_USE_PYVIEWER)
 
 
 ##
-# Python-based packages
+# Python-based packages, part 1 (generic)
 ##
 IF(SALOME_USE_PYCONSOLE) 
-  SET(SUBDIRS_PYCONSOLE PyInterp PyConsole)
-  SET(SUBDIRS_PYTHON SALOME_PYQT)
-  IF(SALOME_USE_VTKVIEWER)
-    LIST(APPEND SUBDIRS_PYTHON SALOME_PY)
-  ENDIF()
-  IF(SALOME_USE_SALOMEOBJECT)
-    LIST(APPEND SUBDIRS_PYTHON SALOME_SWIG)
-  ENDIF()
+  ADD_SUBDIRECTORY(PyInterp)
+  ADD_SUBDIRECTORY(PyConsole)
+  ADD_SUBDIRECTORY(SALOME_PYQT)
 ENDIF(SALOME_USE_PYCONSOLE)
 
 ##
 # Light SALOME packages
 ##
-SET(SUBDIRS_LIGHT LightApp ResExporter)
+ADD_SUBDIRECTORY(LightApp)
+ADD_SUBDIRECTORY(ResExporter)
+
+##
+# Python-based packages, part 2 (LightApp-dependent)
+##
+IF(SALOME_USE_PYCONSOLE) 
+  IF(SALOME_USE_VTKVIEWER)
+    ADD_SUBDIRECTORY(SALOME_PY)
+  ENDIF(SALOME_USE_VTKVIEWER)
+  IF(SALOME_USE_SALOMEOBJECT)
+    ADD_SUBDIRECTORY(SALOME_SWIG)
+  ENDIF(SALOME_USE_VTKVIEWER)
+ENDIF(SALOME_USE_PYCONSOLE)
 
 ##
 # Full (CORBA) SALOME packages
 ##
 IF(NOT SALOME_LIGHT_ONLY)
-  SET(SUBDIRS_CORBA TOOLSGUI SalomeApp Session GuiHelpers TreeData)
+  ADD_SUBDIRECTORY(TOOLSGUI)
+  ADD_SUBDIRECTORY(SalomeApp)
+  ADD_SUBDIRECTORY(Session)
+  ADD_SUBDIRECTORY(GuiHelpers)
+  ADD_SUBDIRECTORY(TreeData)
 ENDIF(NOT SALOME_LIGHT_ONLY)
-
-SET(SUBDIRS
-  ${SUBDIRS_COMMON}
-  ${SUBDIRS_OBJECT}
-  ${SUBDIRS_GLVIEWER}
-  ${SUBDIRS_VTKVIEWER}
-  ${SUBDIRS_OCCVIEWER}
-  ${SUBDIRS_PLOT2DVIEWER}
-  ${SUBDIRS_QXGRAPHVIEWER}
-  ${SUBDIRS_PVVIEWER}
-  ${SUBDIRS_GRAPHICSVIEW}
-  ${SUBDIRS_PYVIEWER}
-  ${SUBDIRS_PYCONSOLE}
-  ${SUBDIRS_LIGHT}
-  ${SUBDIRS_CORBA}
-  ${SUBDIRS_PYTHON}
-)
-
-FOREACH(dir ${SUBDIRS})
- ADD_SUBDIRECTORY(${dir})
-ENDFOREACH(dir ${SUBDIRS})
-            
index 17f5c45a854b3ef787106dcca61eb5d44121ef6f..a69ace13358b076cf121a8f7ca17a19a01768ef3 100755 (executable)
@@ -35,12 +35,8 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/SUIT
   ${PROJECT_SOURCE_DIR}/src/ViewerData
   ${PROJECT_SOURCE_DIR}/src/ViewerTools
+  ${PROJECT_SOURCE_DIR}/src/OpenGLUtils
 )
-IF(SALOME_USE_GLVIEWER)
-  INCLUDE_DIRECTORIES(
-    ${PROJECT_SOURCE_DIR}/src/OpenGLUtils
-    )
-ENDIF()
 
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
@@ -49,15 +45,9 @@ ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
 SET(_link_LIBRARIES
   ${OPENGL_LIBRARIES} ${QT_LIBRARIES} ${CAS_KERNEL} ${CAS_VIEWER} ${CAS_TKGeomAlgo}
   ${CAS_TKTopAlgo} ${CAS_TKG2d} ${CAS_TKOpenGl}
-  CASCatch qtx suit ViewerTools ViewerData
+  CASCatch qtx suit ViewerTools ViewerData OpenGLUtils
 )
 
-IF(SALOME_USE_GLVIEWER)
-  LIST(APPEND _link_LIBRARIES
-    OpenGLUtils
-    )
-ENDIF()
-
 # --- headers ---
 
 # header files / to be processed by moc
index 08f89e26992ef4e03c1f1e4cee1f0de4e597f85e..0599c7534b8d2a921b773998d43c0b17388f3c55 100755 (executable)
@@ -49,9 +49,7 @@
 #include <QtxMultiAction.h>
 #include <QtxRubberBand.h>
 
-#ifndef DISABLE_GLVIEWER
-  #include <OpenGLUtils_FrameBuffer.h>
-#endif
+#include <OpenGLUtils_FrameBuffer.h>
 
 #include <QPainter>
 #include <QTime>
index 4f7796dbbaab0b95aa70e73b281fb7b13acd825b..69f99a0140f0587260e8bd9586344fdae9a7e7c8 100755 (executable)
@@ -34,14 +34,9 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/OBJECT
   ${PROJECT_SOURCE_DIR}/src/Prs
   ${PROJECT_SOURCE_DIR}/src/VTKViewer
+  ${PROJECT_SOURCE_DIR}/src/OpenGLUtils
 )
 
-IF(SALOME_USE_GLVIEWER)
-  INCLUDE_DIRECTORIES(
-    ${PROJECT_SOURCE_DIR}/src/OpenGLUtils
-    )
-ENDIF()
-
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS})
 
@@ -52,15 +47,9 @@ SET(_link_LIBRARIES
   ${VTK_LIBRARIES} 
   ${CAS_KERNEL} ${CAS_VIEWER}
   ${KERNEL_OpUtil}
-  qtx suit ViewerTools SalomeObject SalomePrs VTKViewer
+  qtx suit ViewerTools SalomeObject SalomePrs VTKViewer OpenGLUtils
 )
 
-IF(SALOME_USE_GLVIEWER)
-  LIST(APPEND _link_LIBRARIES 
-    OpenGLUtils
-    )
-ENDIF()
-
 # --- headers ---
 
 # header files / to be processed by moc
index f8fc7c41d2acf99b33fd834f0b4761668d491586..88bb74354f6fee0638375c19eaef443fe2d1dd7d 100755 (executable)
 #include "VTKViewer_Algorithm.h"
 #include "SVTK_Functor.h"
 
-#ifndef DISABLE_GLVIEWER
-  #include <OpenGLUtils_FrameBuffer.h>
-#endif
-
+#include <OpenGLUtils_FrameBuffer.h>
 
 namespace SVTK
 {
@@ -126,10 +123,6 @@ namespace SVTK
   }
 }
 
-
-
-
-
 /*!
   Constructor
 */