From 66980172785470112ba6f03724903d79150d5141 Mon Sep 17 00:00:00 2001 From: rnv Date: Tue, 29 Oct 2013 06:44:21 +0000 Subject: [PATCH] Porting SALOME HELLO module to win32 platform. --- src/HELLO/CMakeLists.txt | 5 +++++ src/HELLO/HELLO.hxx | 14 +++++++++++++- src/HELLOGUI/HELLOGUI.cxx | 2 ++ src/HELLOGUI/HELLOGUI.h | 13 ++++++++++++- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/HELLO/CMakeLists.txt b/src/HELLO/CMakeLists.txt index b517c8b..ff115d3 100644 --- a/src/HELLO/CMakeLists.txt +++ b/src/HELLO/CMakeLists.txt @@ -26,6 +26,11 @@ INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR}/idl ) +# --- definitions --- +ADD_DEFINITIONS( + ${OMNIORB_DEFINITIONS} +) + # libraries to link to SET(_link_LIBRARIES ${OMNIORB_LIBRARIES} diff --git a/src/HELLO/HELLO.hxx b/src/HELLO/HELLO.hxx index 325ec96..d619f33 100644 --- a/src/HELLO/HELLO.hxx +++ b/src/HELLO/HELLO.hxx @@ -23,11 +23,22 @@ #ifndef _HELLO_HXX_ #define _HELLO_HXX_ +#ifdef WIN32 +# if defined HELLOENGINE_EXPORTS || defined HELLOEngine_EXPORTS +# define HELLOENGINE_EXPORT __declspec( dllexport ) +# else +# define HELLOENGINE_EXPORT __declspec( dllimport ) +# endif +#else +# define HELLOENGINE_EXPORT +#endif + + #include #include CORBA_SERVER_HEADER(HELLO_Gen) #include -class HELLO: +class HELLOENGINE_EXPORT HELLO : public POA_HELLO_ORB::HELLO_Gen, public Engines_Component_i { @@ -48,6 +59,7 @@ public: }; extern "C" +HELLOENGINE_EXPORT PortableServer::ObjectId* HELLOEngine_factory( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId* contId, diff --git a/src/HELLOGUI/HELLOGUI.cxx b/src/HELLOGUI/HELLOGUI.cxx index ae0d83a..428fb4f 100644 --- a/src/HELLOGUI/HELLOGUI.cxx +++ b/src/HELLOGUI/HELLOGUI.cxx @@ -892,11 +892,13 @@ void HELLOGUI::init() // Export the module extern "C" { // FACTORY FUNCTION: create an instance of the Hello module GUI + HELLO_EXPORT CAM_Module* createModule() { return new HELLOGUI(); } // VERSIONING FUNCTION: get Hello module's version identifier + HELLO_EXPORT char* getModuleVersion() { return (char*)HELLO_VERSION_STR; // HELLO_VERSION_STR is defined in HELLO_version.h diff --git a/src/HELLOGUI/HELLOGUI.h b/src/HELLOGUI/HELLOGUI.h index f6dcc7b..e38eb26 100644 --- a/src/HELLOGUI/HELLOGUI.h +++ b/src/HELLOGUI/HELLOGUI.h @@ -25,6 +25,17 @@ #ifndef _HELLOGUI_H_ #define _HELLOGUI_H_ + +#ifdef WIN32 +# if defined HELLO_EXPORTS || defined Hello_EXPORTS +# define HELLO_EXPORT __declspec( dllexport ) +# else +# define HELLO_EXPORT __declspec( dllimport ) +# endif +#else +# define HELLO_EXPORT +#endif + #include #include @@ -32,7 +43,7 @@ class SalomeApp_Application; -class HELLOGUI: public SalomeApp_Module +class HELLO_EXPORT HELLOGUI: public SalomeApp_Module { Q_OBJECT -- 2.30.2