Salome HOME
First integration of Salome On Demand
[modules/gui.git] / src / LightApp / CMakeLists.txt
old mode 100755 (executable)
new mode 100644 (file)
index 94122a0..b53f593
@@ -1,9 +1,9 @@
-# Copyright (C) 2012-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-INCLUDE(UseQt4Ext)
+INCLUDE(UseQtExt)
 
 # --- options ---
 
 # additional include directories
 INCLUDE_DIRECTORIES(
-  ${CAS_INCLUDE_DIRS}
+  ${OpenCASCADE_INCLUDE_DIR}
   ${QT_INCLUDES}
   ${HDF5_INCLUDE_DIRS}
   ${PTHREAD_INCLUDE_DIR}
@@ -45,12 +45,25 @@ ENDIF()
 IF(SALOME_USE_GLVIEWER)
   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/GLViewer)
 ENDIF()
+IF(SALOME_USE_GRAPHICSVIEW)
+  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/GraphicsView)
+ENDIF()
+IF(SALOME_USE_PYVIEWER)
+  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/PyEditor)
+  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/PyViewer)
+ENDIF()
 IF(SALOME_USE_OCCVIEWER)
   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/OCCViewer)
   IF(SALOME_USE_SALOMEOBJECT)
     INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/SOCC)
   ENDIF()
 ENDIF()
+IF(SALOME_USE_PV3DVIEWER)
+  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/PV3DViewer)
+  IF(SALOME_USE_SALOMEOBJECT)
+    INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/SPV3D)
+  ENDIF()
+ENDIF()
 IF(SALOME_USE_PLOT2DVIEWER)
   INCLUDE_DIRECTORIES(${QWT_INCLUDE_DIR})
   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Plot2d)
@@ -59,7 +72,6 @@ IF(SALOME_USE_PLOT2DVIEWER)
   ENDIF()
 ENDIF()
 IF(SALOME_USE_VTKVIEWER)
-  INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/VTKViewer)
   IF(SALOME_USE_SALOMEOBJECT)
     INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/SVTK)
@@ -68,66 +80,61 @@ ENDIF()
 IF(SALOME_USE_QXGRAPHVIEWER)
   INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/QxScene)
 ENDIF()
+IF(SALOME_USE_PVVIEWER)
+  INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/PVViewer)
+ENDIF()
 IF(SALOME_USE_PYCONSOLE)
   INCLUDE_DIRECTORIES(
     ${PYTHON_INCLUDE_DIRS}
-    ${PROJECT_SOURCE_DIR}/src/PyConsole
-    ${PROJECT_SOURCE_DIR}/src/PyInterp
+    ${PROJECT_SOURCE_DIR}/tools/PyConsole/src
+    ${PROJECT_SOURCE_DIR}/tools/PyInterp/src
     ${PROJECT_SOURCE_DIR}/src/SUITApp
   )
 ENDIF()
 
 # additional preprocessor / compiler flags
-ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS} ${HDF5_DEFINITIONS})
-IF(NOT WIN32)
-  ADD_DEFINITIONS("-Wno-deprecated")
-ENDIF()
-IF(NOT SALOME_USE_SALOMEOBJECT)
-  ADD_DEFINITIONS("-DDISABLE_SALOMEOBJECT")
-ENDIF()
-IF (NOT SALOME_USE_GLVIEWER)
-  ADD_DEFINITIONS("-DDISABLE_GLVIEWER")
-ENDIF()
-IF(NOT SALOME_USE_OCCVIEWER)
-  ADD_DEFINITIONS("-DDISABLE_OCCVIEWER")
-ENDIF()
+ADD_DEFINITIONS(${OpenCASCADE_DEFINITIONS} ${QT_DEFINITIONS} ${HDF5_DEFINITIONS})
 IF(SALOME_USE_PLOT2DVIEWER)
   ADD_DEFINITIONS(${QWT_DEFINITIONS})
-ELSE()
-  ADD_DEFINITIONS("-DDISABLE_PLOT2DVIEWER")
-ENDIF()
-IF(NOT SALOME_USE_VTKVIEWER)
-  ADD_DEFINITIONS("-DDISABLE_VTKVIEWER")
-ENDIF()
-IF(NOT SALOME_USE_QXGRAPHVIEWER)
-  ADD_DEFINITIONS("-DDISABLE_QXGRAPHVIEWER")
 ENDIF()
 IF(SALOME_USE_PYCONSOLE)
   ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
-ELSE()
-  ADD_DEFINITIONS("-DDISABLE_PYCONSOLE")
 ENDIF()
 
 # libraries to link to
 SET(_link_LIBRARIES
-  ${CAS_KERNEL}
+  ${OpenCASCADE_FoundationClasses_LIBRARIES}
   ${QT_LIBRARIES}
   ${HDF5_LIBRARIES}
-  CASCatch qtx suit std SalomeStyle SalomePrs CAM LogWindow ObjBrowser 
+  CASCatch qtx suit std SalomeStyle SalomePrs CAM LogWindow ObjBrowser Event
   ${KERNEL_SalomeHDFPersist} ${KERNEL_SALOMELocalTrace}
+  ${GRAPHVIZ_LIBRARIES}
 )
+
 IF(SALOME_USE_SALOMEOBJECT)
   LIST(APPEND _link_LIBRARIES SalomeObject)
 ENDIF()
 IF(SALOME_USE_GLVIEWER)
   LIST(APPEND _link_LIBRARIES GLViewer)
 ENDIF()
+IF(SALOME_USE_GRAPHICSVIEW)
+  LIST(APPEND _link_LIBRARIES GraphicsView)
+ENDIF()
+IF(SALOME_USE_PYVIEWER)
+  LIST(APPEND _link_LIBRARIES PyEditor PyViewer)
+ENDIF()
 IF(SALOME_USE_OCCVIEWER)
   LIST(APPEND _link_LIBRARIES OCCViewer)
   IF(SALOME_USE_SALOMEOBJECT)
     LIST(APPEND _link_LIBRARIES SOCC)
   ENDIF()
 ENDIF()
+IF(SALOME_USE_PV3DVIEWER)
+  LIST(APPEND _link_LIBRARIES PV3DViewer)
+  IF(SALOME_USE_SALOMEOBJECT)
+    LIST(APPEND _link_LIBRARIES SPV3D)
+  ENDIF()
+ENDIF()
 IF(SALOME_USE_PLOT2DVIEWER)
   LIST(APPEND _link_LIBRARIES Plot2d)
   IF(SALOME_USE_SALOMEOBJECT)
@@ -143,6 +150,9 @@ ENDIF()
 IF(SALOME_USE_QXGRAPHVIEWER)
   LIST(APPEND _link_LIBRARIES QxScene)
 ENDIF()
+IF(SALOME_USE_PVVIEWER)
+  LIST(APPEND _link_LIBRARIES PVViewer)
+ENDIF()
 IF(SALOME_USE_PYCONSOLE)
   LIST(APPEND _link_LIBRARIES PyInterp PyConsole SUITApp)
 ENDIF()
@@ -150,7 +160,7 @@ ENDIF()
 # --- headers ---
 
 # header files / to be processed by moc
-SET(_moc_HEADERS   
+SET(_moc_HEADERS
   LightApp_AboutDlg.h
   LightApp_Application.h
   LightApp_DataModel.h
@@ -168,13 +178,22 @@ SET(_moc_HEADERS
   LightApp_Study.h
   LightApp_SwitchOp.h
   LightApp_WgViewModel.h
+  LightApp_ExtInfoDlg.h
 )
 IF(SALOME_USE_GLVIEWER)
   LIST(APPEND _moc_HEADERS LightApp_GLSelector.h)
 ENDIF()
+IF(SALOME_USE_GRAPHICSVIEW)
+  LIST(APPEND _moc_HEADERS LightApp_GVSelector.h)
+ENDIF()
 IF(SALOME_USE_OCCVIEWER)
   LIST(APPEND _moc_HEADERS LightApp_OCCSelector.h)
 ENDIF()
+IF(SALOME_USE_PV3DVIEWER)
+  IF(SALOME_USE_SALOMEOBJECT)
+    LIST(APPEND _moc_HEADERS LightApp_PV3DSelector.h)
+  ENDIF()
+ENDIF()
 IF(SALOME_USE_PLOT2DVIEWER)
   LIST(APPEND _moc_HEADERS LightApp_Plot2dSelector.h)
 ENDIF()
@@ -183,6 +202,9 @@ IF(SALOME_USE_VTKVIEWER)
     LIST(APPEND _moc_HEADERS LightApp_VTKSelector.h)
   ENDIF()
 ENDIF()
+IF(SALOME_USE_PYCONSOLE)
+  LIST(APPEND _moc_HEADERS LightApp_PyEditor.h)
+ENDIF()
 
 # header files / no moc processing
 SET(_other_HEADERS
@@ -193,14 +215,12 @@ SET(_other_HEADERS
   LightApp_Displayer.h
   LightApp_Driver.h
   LightApp_EventFilter.h
+  LightApp_FileValidator.h
   LightApp_FullScreenHelper.h
   LightApp_HDFDriver.h
   LightApp_Selection.h
   LightApp_UpdateFlags.h
 )
-IF(SALOME_USE_PYCONSOLE)
-  LIST(APPEND _other_HEADERS LightApp_PyInterp.h)
-ENDIF()
 
 # header files / to install
 SET(LightApp_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
@@ -224,19 +244,22 @@ SET(_other_RESOURCES
   resources/icon_applogo.png
   resources/icon_default.png
   resources/icon_module.png
-  resources/icon_module_big.png
   resources/icon_select.png
-  resources/LightApp.ini
+  resources/icon_earth.png
+  resources/icon_life_ring.png
+  resources/icon_add_module.png
+  resources/icon_remove_module.png
+  resources/icon_info_module.png
   resources/LightApp.xml
 )
 
 # --- sources ---
 
-# sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
-
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
+
+# sources / rcc wrappings
+QT_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
 
 # sources / static
 SET(_other_SOURCES
@@ -250,6 +273,7 @@ SET(_other_SOURCES
   LightApp_Displayer.cxx
   LightApp_Driver.cxx
   LightApp_EventFilter.cxx
+  LightApp_FileValidator.cxx
   LightApp_FullScreenHelper.cxx
   LightApp_HDFDriver.cxx
   LightApp_Module.cxx
@@ -266,13 +290,22 @@ SET(_other_SOURCES
   LightApp_Study.cxx
   LightApp_SwitchOp.cxx
   LightApp_WgViewModel.cxx
+  LightApp_ExtInfoDlg.cxx
 )
 IF(SALOME_USE_GLVIEWER)
   LIST(APPEND _other_SOURCES LightApp_GLSelector.cxx)
 ENDIF()
+IF(SALOME_USE_GRAPHICSVIEW)
+  LIST(APPEND _other_SOURCES LightApp_GVSelector.cxx)
+ENDIF()
 IF(SALOME_USE_OCCVIEWER)
   LIST(APPEND _other_SOURCES LightApp_OCCSelector.cxx)
 ENDIF()
+IF(SALOME_USE_PV3DVIEWER)
+  IF(SALOME_USE_SALOMEOBJECT)
+    LIST(APPEND _other_SOURCES LightApp_PV3DSelector.cxx)
+  ENDIF()
+ENDIF()
 IF(SALOME_USE_PLOT2DVIEWER)
   LIST(APPEND _other_SOURCES LightApp_Plot2dSelector.cxx)
 ENDIF()
@@ -282,7 +315,7 @@ IF(SALOME_USE_VTKVIEWER)
   ENDIF()
 ENDIF()
 IF(SALOME_USE_PYCONSOLE)
-  LIST(APPEND _other_SOURCES LightApp_PyInterp.cxx)
+  LIST(APPEND _other_SOURCES LightApp_PyEditor.cxx)
 ENDIF()
 
 # sources / to compile
@@ -295,6 +328,6 @@ TARGET_LINK_LIBRARIES(LightApp ${_link_LIBRARIES})
 INSTALL(TARGETS LightApp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 INSTALL(FILES ${LightApp_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
 
 INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})