Salome HOME
Debug of CMake build procedure
[modules/gui.git] / adm_local / cmake_files / FindSalomeGUI.cmake
index f397b0708c9af67054b377f4367ffa043e3b8355..90e66d9e278446881f48ea271d0ae3281f8b5472 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014  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
@@ -16,7 +16,6 @@
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-#
 # Author: Adrien Bruneton
 #
 
@@ -36,4 +35,49 @@ SALOME_FIND_PACKAGE(SalomeGUI SalomeGUI CONFIG)
 
 IF(NOT SalomeGUI_FIND_QUIETLY)
   MESSAGE(STATUS "Found Salome GUI: ${GUI_ROOT_DIR}")
-ENDIF()
\ No newline at end of file
+ENDIF()
+
+FOREACH(_res ${SalomeGUI_EXTRA_ENV})
+  SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeGUI_EXTRA_ENV_${_res}}")
+ENDFOREACH()
+
+#----------------------------------------------------------------------------
+# FULL_GUI is a macro useful for determining whether a GUI module 
+# builded in full mode 
+#----------------------------------------------------------------------------
+#########################################################################
+# FULL_GUI()
+# 
+# USAGE: FULL_GUI(with_corba)
+#
+# ARGUMENTS:
+#   with_corba [input] TRUE or FALSE - use CORBA for building module or no.
+#
+MACRO(FULL_GUI with_corba)
+  SET(_options)
+  IF(${with_corba} AND ${SALOME_GUI_LIGHT_ONLY})
+    SET(_corba_message "We absolutely need a Salome GUI module with CORBA.\nPlease set option SALOME_LIGHT_ONLY to OFF when building GUI module.")
+  ENDIF() 
+  
+  LIST(APPEND _options SALOME_USE_OCCVIEWER SALOME_USE_GLVIEWER SALOME_USE_VTKVIEWER
+              SALOME_USE_PLOT2DVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_QXGRAPHVIEWER
+              SALOME_USE_SALOMEOBJECT SALOME_USE_PYCONSOLE)
+              
+  SET(_message) 
+  FOREACH(_option ${_options}) 
+    IF(NOT ${_option})
+      LIST(APPEND _message ${_option})
+    ENDIF()
+  ENDFOREACH()
+  IF(_message)
+    SET(_message "We absolutely need a Salome GUI module in full mode.\nThe following options should be set to ON when building GUI module:\n${_message}\n")
+    IF(_corba_message)
+      MESSAGE(FATAL_ERROR "${_corba_message}\n${_message}")
+    ELSE()
+      MESSAGE(FATAL_ERROR "${_message}")
+    ENDIF()
+  ELSEIF(_corba_message)
+    MESSAGE(FATAL_ERROR "${_corba_message}") 
+  ENDIF() 
+  
+ENDMACRO(FULL_GUI)