X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=adm_local%2Fcmake_files%2FFindSalomeGUI.cmake;h=0e441f94b4b84832f662e855890e5cd2d2a00846;hb=11a370454e581b8e532a2a58bff6cd18136ebafd;hp=90e66d9e278446881f48ea271d0ae3281f8b5472;hpb=6878ef4d7381638ec39d1ca9d03afc21a69401aa;p=modules%2Fgui.git diff --git a/adm_local/cmake_files/FindSalomeGUI.cmake b/adm_local/cmake_files/FindSalomeGUI.cmake index 90e66d9e2..0e441f94b 100644 --- a/adm_local/cmake_files/FindSalomeGUI.cmake +++ b/adm_local/cmake_files/FindSalomeGUI.cmake @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2015 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 @@ -42,42 +42,68 @@ FOREACH(_res ${SalomeGUI_EXTRA_ENV}) ENDFOREACH() #---------------------------------------------------------------------------- -# FULL_GUI is a macro useful for determining whether a GUI module -# builded in full mode +# SALOME_GUI_WITH_CORBA is a macro useful for determining whether a SALOME GUI module +# is built in not light mode (with CORBA) +#---------------------------------------------------------------------------- +MACRO(SALOME_GUI_WITH_CORBA) + IF(SALOME_GUI_LIGHT_ONLY) + MESSAGE(FATAL_ERROR "\nWe absolutely need a Salome GUI module with CORBA.\nPlease set option SALOME_LIGHT_ONLY to OFF when building GUI module.") + ENDIF() +ENDMACRO(SALOME_GUI_WITH_CORBA) + + +#---------------------------------------------------------------------------- +# SALOME_GUI_MODE is a macro useful for determining whether a GUI module +# builded in particular mode #---------------------------------------------------------------------------- ######################################################################### -# FULL_GUI() +# SALOME_GUI_MODE() # -# USAGE: FULL_GUI(with_corba) +# USAGE: SALOME_GUI_MODE(_options) # # ARGUMENTS: -# with_corba [input] TRUE or FALSE - use CORBA for building module or no. +# _options [input] List - The list of CMake options given to SALOME GUI # -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}") +# 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() - MESSAGE(FATAL_ERROR "${_message}") + SALOME_JUSTIFY_STRING(${_option} ${_length} _option_name) + MESSAGE(STATUS " * ${_option_name} -> ${${_option}}") + IF(NOT ${_option} AND NOT ${_is_optional}) + LIST(APPEND _message ${_option}) + ENDIF() ENDIF() - ELSEIF(_corba_message) - MESSAGE(FATAL_ERROR "${_corba_message}") - ENDIF() + ENDFOREACH() + MESSAGE(STATUS "") -ENDMACRO(FULL_GUI) + IF(_message) + SET(_message "We absolutely need a Salome GUI module in special mode. The following options should be set to ON when building GUI module: \n${_message}\n") + MESSAGE(FATAL_ERROR "${_message}") + ENDIF() +ENDMACRO(SALOME_GUI_MODE)