-MACRO(SALOME_GUI_MODE _options)
- MESSAGE(STATUS "Checking status of GUI options ${_options}")
- SET(_message)
- FOREACH(_option ${_options})
- IF(NOT ${_option})
- LIST(APPEND _message ${_option})
+# Notes:
+# - The arguments list can include "OPTIONAL" keywords:
+# * All arguments preceded by "OPTIONAL" keyword are mandatory for current module.
+# If GUI module was compiled without this functionality, further installation
+# of the current module becomes impossible.
+# * All arguments following "OPTIONAL" keyword are optional for current module, which
+# uses this functionality, but can be installed without it.
+#
+# - At present there are next options in the GUI module:
+# SALOME_USE_OCCVIEWER, SALOME_USE_VTKVIEWER, SALOME_USE_GLVIEWER, SALOME_USE_PLOT2DVIEWER,
+# SALOME_USE_GRAPHICSVIEW, SALOME_USE_QXGRAPHVIEWER, SALOME_USE_PVVIEWER, SALOME_USE_PYVIEWER,
+# SALOME_USE_PYCONSOLE, SALOME_USE_SALOMEOBJECT
+#
+# Example of usage:
+# SALOME_GUI_MODE(SALOME_USE_OCCVIEWER SALOME_USE_SALOMEOBJECT OPTIONAL SALOME_USE_PYCONSOLE)
+#
+MACRO(SALOME_GUI_MODE)
+ MESSAGE(STATUS "")
+ MESSAGE(STATUS " Checking status of GUI options")
+ MESSAGE(STATUS " ==================================== ")
+ MESSAGE(STATUS "")
+ SET(_message)
+ SET(_length 25)
+ SET(_is_optional OFF)
+ FOREACH(_option ${ARGN})
+ IF(${_option} STREQUAL "OPTIONAL")
+ SET(_is_optional ON)
+ MESSAGE(STATUS " Optional:")
+ ELSE()
+ SALOME_JUSTIFY_STRING(${_option} ${_length} _option_name)
+ MESSAGE(STATUS " * ${_option_name} -> ${${_option}}")
+ IF(NOT ${_option} AND NOT ${_is_optional})
+ LIST(APPEND _message ${_option})
+ ENDIF()