Salome HOME
Copyright update 2022
[modules/paravis.git] / src / PVGUI / CMakeLists.txt
index 60ac2364e957b43346f4db80dee95db5e1cad5e9..a248fc05fb029afa185b995d497dbd8c5d9f0574 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2010-2013  CEA/DEN, EDF R&D
+# Copyright (C) 2010-2022  CEA/DEN, EDF R&D
 #
 # 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 ---
 
-INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR} 
+INCLUDE_DIRECTORIES(
     ${KERNEL_INCLUDE_DIRS}
-    ${GUI_INCLUDE_DIRS} 
-    ${PROJECT_BINARY_DIR}/idl 
+    ${GUI_INCLUDE_DIRS}  
     ${PROJECT_BINARY_DIR} 
-    ${CAS_INCLUDE_DIRS} 
     ${Boost_INCLUDE_DIRS}
     ${QT_INCLUDES}
     ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_BINARY_DIR}
     )
 
 # additional preprocessor / compiler flags
-ADD_DEFINITIONS(${CAS_DEFINITIONS})
 ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
-ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
 
 # libraries to link to
-SET(_PARAVIEW_APP_COMPO_LIB
-  pqApplicationComponents
-  )
 
 SET(_link_LIBRARIES 
-  ${OMNIORB_LIBRARIES}
   ${QT_LIBRARIES}
-  ${CAS_KERNEL}
   ${PYTHON_LIBS}
-  ${KERNEL_LDFLAGS} ${KERNEL_SalomeDS} ${KERNEL_SALOMELocalTrace} ${KERNEL_SalomeIDLKernel} 
-                    ${KERNEL_SalomeNS} ${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SalomeContainer} ${KERNEL_TOOLSDS}
-  ${GUI_LDFLAGS} ${GUI_SalomeApp} ${GUI_LightApp} ${GUI_CAM} ${GUI_qtx} ${GUI_suit} ${GUI_Event} ${GUI_PyInterp} 
-                 ${GUI_SalomeObject} ${GUI_vtkTools}
-  ${MED_SalomeIDLMED}
-  ${_PARAVIEW_APP_COMPO_LIB}
-  SalomeIDLPARAVIS
+  ${KERNEL_LDFLAGS}
+  ${GUI_LDFLAGS} ${GUI_LightApp} ${GUI_CAM} ${GUI_qtx} ${GUI_suit}
+                 ${GUI_SalomeObject}
+  ParaView::pqApplicationComponents             
+  ${GUI_PVViewer}
 )
 
 # --- headers ---
 
+SET(_ui_files
+    resources/pqCustomSettingsWidget.ui
+    )
+
+QT_WRAP_UIC(_ui_FORMS_HEADERS ${_ui_files})
+
 # header files / to be processed by moc
 SET(_moc_HEADERS
   PVGUI_Module.h
-  PVGUI_ViewManager.h
-  PVGUI_ViewModel.h
-  PVGUI_ViewWindow.h
+  PVGUI_DataModel.h
   PVGUI_ParaViewSettingsPane.h
 )
 
-# header files / no moc processing
-SET(_other_HEADERS
-  PVGUI_OutputWindowAdapter.h
-  PVGUI_Tools.h
-  #PVGUI_MatplotlibMathTextUtilities.h
-  PV_I.h
-  PARAVIS_Gen_i.hh
-  PV_Events.h
-  PV_Tools.h
-)
-
 # header files / to install
-SET(PVGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
+SET(PVGUI_HEADERS ${_moc_HEADERS} ${_ui_FORMS_HEADERS})
 
 # --- resources ---
 
@@ -101,7 +84,7 @@ IF(SALOME_BUILD_DOC)
   # Check ParaView documentation file existence
   # if it exists add it to the resources (compile into binary form)
   # otherwise print warning message
-  SET(PV_DOC_FILE ${VTK_INSTALL_PREFIX}/share/doc/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}/paraview.qch)
+  SET(PV_DOC_FILE ${ParaView_PREFIX_PATH}/share/doc/ParaView/paraview.qch)
   IF (EXISTS ${PV_DOC_FILE})
     SET(RC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/PVGUI.qrc.in)
     SET(RC_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/PVGUI.qrc)
@@ -117,98 +100,35 @@ ENDIF()
 # --- sources ---
 
 # sources / rcc wrappings
-QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+QT_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
 
 # sources / moc wrappings
-QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
-
-# sources / EDF specific stuff
-INCLUDE(vtkWrapClientServer)
-VTK_WRAP_ClientServer(vtkEDFCutterCS vtkEDFCutter_SRCS ${GUI_ROOT_DIR}/include/salome/vtkEDFCutter.h)
+QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
 
 # sources / static
 SET(_other_SOURCES
   PVGUI_Module.cxx
   PVGUI_Module_actions.cxx
   PVGUI_Module_widgets.cxx
-  PVGUI_ViewManager.cxx
-  PVGUI_ViewModel.cxx
-  PVGUI_ViewWindow.cxx
-  PVGUI_OutputWindowAdapter.cxx
-  PVGUI_Tools.cxx
   PVGUI_ParaViewSettingsPane.cxx
-  #PVGUI_MatplotlibMathTextUtilities.cxx
-  PARAVIS_Gen_i.cc
-  PV_Tools.cxx
+  PVGUI_DataModel.cxx
   )
 
-IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
-  # Generate headers and sources corresponding to the IDL implementations:
-  INCLUDE(${PROJECT_SOURCE_DIR}/src/VTKWrapping/wrap.cmake)
-
-  ## From 2.8.10, we should use:
-  ## SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
-
-  # Make the list of wrapped files visible from the top directory (will be used in idl):
-  SET(WRAP_IDL_I_HH "${WRAP_IDL_I_HH}" PARENT_SCOPE)
-  SET(WRAP_IDL_I_CC "${WRAP_IDL_I_CC}" PARENT_SCOPE)
-
-  SET(_VTK_wrap_SOURCES
-    PARAVIS_CreateClass.cxx
-    ${WRAP_IDL_I_CC}
-  )
-ENDIF()
-  
 # sources / to compile
 SET(PVGUI_SOURCES 
   ${_other_SOURCES} 
   ${_moc_SOURCES} 
   ${_rcc_SOURCES} 
-  ${vtkEDFCutter_SRCS} 
   ${_VTK_wrap_SOURCES}
+  ${_ui_FORMS_HEADERS}
   )
 
 # --- rules ---
-
-IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
-  ADD_CUSTOM_COMMAND(
-   OUTPUT PARAVIS_CreateClass.cxx
-    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/VTKWrapping/create_class.py ${CMAKE_BINARY_DIR}
-    DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt 
-         ${PROJECT_BINARY_DIR}/idl/PARAVIS_Gen.hh 
-         ${PROJECT_BINARY_DIR}/idl/PARAVIS_Gen_Types.hh
-         SalomeIDLPARAVIS
-         generate_implements
-  )
-
-  # All wrapping tools have to be build before generating the above module - NEEDED?
-  ###ADD_DEPENDENCIES(SalomeIDLPARAVIS vtkWrapIDL_HH vtkWrapIDL_CC vtkWrapIDL)
-
-  # Intermediate target used in PVGUI directory (we can not cross reference
-  # a generated source file across directories, hence this trick):
-  INCLUDE_DIRECTORIES(
-    ${PROJECT_BINARY_DIR}/idl
-    ${PROJECT_BINARY_DIR}/src/VTKWrapping
-  )
-ENDIF()
-
 ADD_LIBRARY(PARAVIS ${PVGUI_SOURCES})
-IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
-  # Make sure the generation of the VTK wrapping get executed first:
-  ADD_DEPENDENCIES(PARAVIS PARAVIS_CreateClass.cxx)
-ENDIF()
-
-IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
-  # Ensure .hh files corresponding to IDL have been generated first:
-  ADD_DEPENDENCIES(PARAVIS omniorb_module_SalomeIDLPARAVIS)  
-ENDIF()
-
 TARGET_LINK_LIBRARIES(PARAVIS ${_link_LIBRARIES})
 INSTALL(TARGETS PARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
-
 # --- header and resources installation ---
 INSTALL(FILES ${PVGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}")
 INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA})