From 29484afb3386481a873c31a635fbe41604d9942c Mon Sep 17 00:00:00 2001 From: ana Date: Wed, 19 Sep 2012 11:27:54 +0000 Subject: [PATCH] Compilation SALOME by CMake(windows/linux) --- src/GuiHelpers/Makefile.am | 3 +- src/GuiHelpers/SALOME_AppStudyEditor.hxx | 4 +-- src/GuiHelpers/SALOME_GuiServices.hxx | 16 ++++----- src/GuiHelpers/SalomeGuiHelpers.hxx | 41 ++++++++++++++++++++++++ src/GuiHelpers/StandardApp_Module.hxx | 4 ++- 5 files changed, 56 insertions(+), 12 deletions(-) create mode 100755 src/GuiHelpers/SalomeGuiHelpers.hxx diff --git a/src/GuiHelpers/Makefile.am b/src/GuiHelpers/Makefile.am index dc45c3c80..3ee114677 100644 --- a/src/GuiHelpers/Makefile.am +++ b/src/GuiHelpers/Makefile.am @@ -26,7 +26,8 @@ salomeinclude_HEADERS = \ QtHelper.hxx \ SALOME_GuiServices.hxx \ SALOME_AppStudyEditor.hxx \ - StandardApp_Module.hxx + StandardApp_Module.hxx \ + SalomeGuiHelpers.hxx # Libraries targets lib_LTLIBRARIES = libSalomeGuiHelpers.la diff --git a/src/GuiHelpers/SALOME_AppStudyEditor.hxx b/src/GuiHelpers/SALOME_AppStudyEditor.hxx index 9c05d736d..2dd1a3457 100644 --- a/src/GuiHelpers/SALOME_AppStudyEditor.hxx +++ b/src/GuiHelpers/SALOME_AppStudyEditor.hxx @@ -28,13 +28,13 @@ #include #include "SALOME_StudyEditor.hxx" - +#include "SalomeGuiHelpers.hxx" /*! * This class is a specialization of the KERNEL StudyEditor for * the GUI context. The concept of active study is introduced here * while it does not exist in the pure KERNEL context. */ -class SALOME_AppStudyEditor: public SALOME_StudyEditor { +class SALOMEGUIHELPERS_EXPORT SALOME_AppStudyEditor: public SALOME_StudyEditor { public: SALOME_AppStudyEditor(SalomeApp_Application * salomeApp); int updateActiveStudy(); diff --git a/src/GuiHelpers/SALOME_GuiServices.hxx b/src/GuiHelpers/SALOME_GuiServices.hxx index 990596c8e..dbbab8dfa 100644 --- a/src/GuiHelpers/SALOME_GuiServices.hxx +++ b/src/GuiHelpers/SALOME_GuiServices.hxx @@ -31,13 +31,13 @@ #include CORBA_SERVER_HEADER(SALOMEDS) #include #include - +#include "SalomeGuiHelpers.hxx" namespace GUI { // SALOME GUI main services - SalomeApp_Application * getSalomeApplication(); - LightApp_SelectionMgr * getSelectionManager(); - SUIT_ResourceMgr * getResourcesManager(); + SALOMEGUIHELPERS_EXPORT SalomeApp_Application * getSalomeApplication(); + SALOMEGUIHELPERS_EXPORT LightApp_SelectionMgr * getSelectionManager(); + SALOMEGUIHELPERS_EXPORT SUIT_ResourceMgr * getResourcesManager(); // Helper functions to deal with the study in a GUI context. // @@ -58,14 +58,14 @@ namespace GUI { // depends of the SALOME module technical choices). In general, on // of the attribute of a SObject is a CORBA servant that handles the // data to work with - SALOMEDS::Study_ptr getActiveStudy(); - int getActiveStudyId(); + SALOMEGUIHELPERS_EXPORT SALOMEDS::Study_ptr getActiveStudy(); + SALOMEGUIHELPERS_EXPORT int getActiveStudyId(); // Another way to get the active study (to be converted in // SALOMEDS::Study): - SalomeApp_Study * getSalomeAppActiveStudy(); + SALOMEGUIHELPERS_EXPORT SalomeApp_Study * getSalomeAppActiveStudy(); - SALOMEDS::SObject_ptr IObjectToSObject(const Handle(SALOME_InteractiveObject)& iobject); + SALOMEGUIHELPERS_EXPORT SALOMEDS::SObject_ptr IObjectToSObject(const Handle(SALOME_InteractiveObject)& iobject); template typename TInterface::_var_type IObjectToInterface(const Handle(SALOME_InteractiveObject)& iobject) { diff --git a/src/GuiHelpers/SalomeGuiHelpers.hxx b/src/GuiHelpers/SalomeGuiHelpers.hxx new file mode 100755 index 000000000..9be8bad9f --- /dev/null +++ b/src/GuiHelpers/SalomeGuiHelpers.hxx @@ -0,0 +1,41 @@ +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef SALOMEGUIHELPERS_HXX +#define SALOMEGUIHELPERS_HXX + +#ifdef WIN32 +# if defined SalomeGuiHelpers_EXPORTS || defined SALOMEGUIHELPERS_EXPORTS +# define SALOMEGUIHELPERS_EXPORT __declspec(dllexport) +# else +# define SALOMEGUIHELPERS_EXPORT __declspec(dllimport) +# endif +#else +# define SALOMEGUIHELPERS_EXPORT +#endif + +#if defined WIN32 +#pragma warning ( disable: 4251 ) +#pragma warning ( disable: 4786 ) +#endif + +#endif SALOMEGUIHELPERS_HXX diff --git a/src/GuiHelpers/StandardApp_Module.hxx b/src/GuiHelpers/StandardApp_Module.hxx index 109446321..9909840cc 100644 --- a/src/GuiHelpers/StandardApp_Module.hxx +++ b/src/GuiHelpers/StandardApp_Module.hxx @@ -29,6 +29,8 @@ #include +#include "SalomeGuiHelpers.hxx" + /*! * This class is provided as the base class for the standard gui part * of a SALOME module. To define a gui part, you just have to @@ -56,7 +58,7 @@ * test package (tst/module/gui/Xsalome.hxx and * tst/module/gui/factory.cxx in the XSALOME library). */ -class StandardApp_Module: public SalomeApp_Module +class SALOMEGUIHELPERS_EXPORT StandardApp_Module: public SalomeApp_Module { Q_OBJECT -- 2.39.2