From 0de6295542218a2c4a506512925b2c3eacfed2c4 Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 1 Nov 2013 13:40:40 +0000 Subject: [PATCH] Porting SIERPINSKY module to WIN32 platform. --- src/Sierpinsky/CMakeLists.txt | 6 +++- src/Sierpinsky/SIERPINSKY_Gen_i.cxx | 3 +- src/Sierpinsky/SIERPINSKY_Gen_i.hxx | 12 +++++++- src/SierpinskyGUI/CMakeLists.txt | 10 +++++-- src/SierpinskyGUI/SierpinskyGUI.cxx | 3 +- src/SierpinskyGUI/SierpinskyGUI.h | 6 ++-- src/SierpinskyGUI/SierpinskyGUI.hxx | 37 ++++++++++++++++++++++++ src/SierpinskyGUI/SierpinskyGUI_RunDlg.h | 4 ++- 8 files changed, 72 insertions(+), 9 deletions(-) create mode 100755 src/SierpinskyGUI/SierpinskyGUI.hxx diff --git a/src/Sierpinsky/CMakeLists.txt b/src/Sierpinsky/CMakeLists.txt index 40f1788..92cf03e 100644 --- a/src/Sierpinsky/CMakeLists.txt +++ b/src/Sierpinsky/CMakeLists.txt @@ -33,6 +33,7 @@ INCLUDE_DIRECTORIES( ADD_DEFINITIONS( ${BOOST_DEFINITIONS} ${HDF5_DEFINITIONS} + ${OMNIORB_DEFINITIONS} ) # libraries to link to @@ -48,9 +49,12 @@ SET(_link_LIBRARIES ${SMESH_MEDWrapper} ${CORBA_LIBS} SalomeIDLSIERPINSKY - gd ) +IF(SALOME_SIERPINSKY_USE_LIBGD) + LIST(APPEND _link_LIBRARIES gd) +ENDIF(SALOME_SIERPINSKY_USE_LIBGD) + # --- headers --- # header files / no moc processing diff --git a/src/Sierpinsky/SIERPINSKY_Gen_i.cxx b/src/Sierpinsky/SIERPINSKY_Gen_i.cxx index 8250763..bfe40a5 100644 --- a/src/Sierpinsky/SIERPINSKY_Gen_i.cxx +++ b/src/Sierpinsky/SIERPINSKY_Gen_i.cxx @@ -34,7 +34,8 @@ * Engine factory */ extern "C" -{ +{ + SIERPINSKYENGINE_EXPORT PortableServer::ObjectId * SIERPINSKYEngine_factory( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId* contId, diff --git a/src/Sierpinsky/SIERPINSKY_Gen_i.hxx b/src/Sierpinsky/SIERPINSKY_Gen_i.hxx index 8d77fe0..895bfe2 100644 --- a/src/Sierpinsky/SIERPINSKY_Gen_i.hxx +++ b/src/Sierpinsky/SIERPINSKY_Gen_i.hxx @@ -34,6 +34,16 @@ #include +#ifdef WIN32 + #if defined SIERPINSKYENGINE_EXPORTS || defined SIERPINSKYEngine_EXPORTS + #define SIERPINSKYENGINE_EXPORT __declspec( dllexport ) + #else + #define SIERPINSKYENGINE_EXPORT __declspec( dllimport ) + #endif +#else + #define SIERPINSKYENGINE_EXPORT +#endif + struct MyPoint { double myX; @@ -41,7 +51,7 @@ struct MyPoint MyPoint( const double x = 0., const double y = 0. ) : myX( x ), myY( y ) {} }; -class SIERPINSKY_Gen_i: public virtual POA_SIERPINSKY_ORB::SIERPINSKY, +class SIERPINSKYENGINE_EXPORT SIERPINSKY_Gen_i: public virtual POA_SIERPINSKY_ORB::SIERPINSKY, public virtual Engines_Component_i { public: diff --git a/src/SierpinskyGUI/CMakeLists.txt b/src/SierpinskyGUI/CMakeLists.txt index 60cc0d2..cc4a4d7 100644 --- a/src/SierpinskyGUI/CMakeLists.txt +++ b/src/SierpinskyGUI/CMakeLists.txt @@ -57,15 +57,21 @@ SET(_link_LIBRARIES # --- headers --- # header files / to be processed by moc -SET(SIERPINSKY_HEADERS +SET(_moc_HEADERS SierpinskyGUI_RunDlg.h SierpinskyGUI.h ) +SET(_other_HEADERS + SierpinskyGUI.hxx +) + +SET (SIERPINSKY_HEADERS ${_moc_HEADERS} ${_other_HEADERS}) + # --- sources --- # sources / moc wrappings -QT4_WRAP_CPP(_moc_SOURCES ${SIERPINSKY_HEADERS}) +QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS}) # sources / static SET(_other_SOURCES diff --git a/src/SierpinskyGUI/SierpinskyGUI.cxx b/src/SierpinskyGUI/SierpinskyGUI.cxx index 8b1f47a..81088ab 100644 --- a/src/SierpinskyGUI/SierpinskyGUI.cxx +++ b/src/SierpinskyGUI/SierpinskyGUI.cxx @@ -155,11 +155,12 @@ void SierpinskyGUI::OnRun() } extern "C" { + SIERPINSKY_EXPORT CAM_Module* createModule() { return new SierpinskyGUI(); } - + SIERPINSKY_EXPORT char* getModuleVersion() { return (char*)SIERPINSKY_VERSION_STR; diff --git a/src/SierpinskyGUI/SierpinskyGUI.h b/src/SierpinskyGUI/SierpinskyGUI.h index 7407747..ece1c4f 100644 --- a/src/SierpinskyGUI/SierpinskyGUI.h +++ b/src/SierpinskyGUI/SierpinskyGUI.h @@ -26,6 +26,8 @@ #ifndef __SIERPINSKYGUI_H #define __SIERPINSKYGUI_H +#include "SierpinskyGUI.hxx" + #include #include @@ -34,9 +36,9 @@ class SUIT_Desktop; class SalomeApp_Application; -class SierpinskyGUI : public SalomeApp_Module +class SIERPINSKY_EXPORT SierpinskyGUI : public SalomeApp_Module { - Q_OBJECT; + Q_OBJECT public: // Constructor diff --git a/src/SierpinskyGUI/SierpinskyGUI.hxx b/src/SierpinskyGUI/SierpinskyGUI.hxx new file mode 100755 index 0000000..e93e57d --- /dev/null +++ b/src/SierpinskyGUI/SierpinskyGUI.hxx @@ -0,0 +1,37 @@ +// Copyright (C) 2005-2013 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. +// +// 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 __SIERPINSKYGUI_HXX +#define __SIERPINSKYGUI_HXX + + +#ifdef WIN32 + #if defined SIERPINSKY_EXPORTS || defined Sierpinsky_EXPORTS + #define SIERPINSKY_EXPORT __declspec( dllexport ) + #else + #define SIERPINSKY_EXPORT __declspec( dllimport ) + #endif +#else + #define SIERPINSKY_EXPORT +#endif + + + +#endif // __SIERPINSKYGUI_HXX diff --git a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h index b372506..cd86148 100644 --- a/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h +++ b/src/SierpinskyGUI/SierpinskyGUI_RunDlg.h @@ -26,6 +26,8 @@ #ifndef __SIERPINSKYGUI_RUNDLG_H #define __SIERPINSKYGUI_RUNDLG_H +#include "SierpinskyGUI.hxx" + #include class QLineEdit; @@ -38,7 +40,7 @@ class MyThread; class QProgressBar; class SierpinskyGUI; -class SierpinskyGUI_RunDlg : public QDialog +class SIERPINSKY_EXPORT SierpinskyGUI_RunDlg : public QDialog { Q_OBJECT -- 2.39.2