+# Find GUI
+# ===================
+SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
+IF(EXISTS ${GUI_ROOT_DIR})
+ # We should skip detection of VTK (done automatically from GUI) as we need to detect ParaView instead;
+ # otherwise ParaView targets are not found
+ SET(OMIT_DETECT_PACKAGE_VTK ON)
+ FIND_PACKAGE(SalomeGUI REQUIRED)
+ SALOME_GUI_WITH_CORBA() # check whether GUI builded with CORBA
+ SALOME_GUI_MODE(SALOME_USE_SALOMEOBJECT SALOME_USE_PVVIEWER)
+ ADD_DEFINITIONS(${GUI_DEFINITIONS})
+ INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
+ELSE()
+ MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR")
+ENDIF()
+