Salome HOME
bos #26460 Add SSL mode
authorViktor UZLOV <vuzlov@centos7-01.nnov.opencascade.com>
Tue, 9 Nov 2021 14:24:56 +0000 (17:24 +0300)
committervsr <vsr@opencascade.com>
Mon, 17 Jan 2022 11:27:01 +0000 (14:27 +0300)
15 files changed:
CMakeLists.txt
resources/CMakeLists.txt
src/ATOMSOLV/ATOMSOLV.cxx
src/ATOMSOLV/ATOMSOLV.hxx
src/ATOMSOLV/ATOMSOLV_Component_Generator.cxx [new file with mode: 0644]
src/ATOMSOLV/ATOMSOLV_Component_Generator.hxx [new file with mode: 0644]
src/ATOMSOLV/CMakeLists.txt
src/ATOMSOLVGUI/ATOMSOLVGUI.cxx
src/ATOMSOLVGUI/CMakeLists.txt
src/ATOMSOLV_SWIG/ATOMSOLV_SalomeSessionless.py [new file with mode: 0644]
src/ATOMSOLV_SWIG/AtomsolvHelper.cxx [new file with mode: 0644]
src/ATOMSOLV_SWIG/AtomsolvHelper.h [new file with mode: 0644]
src/ATOMSOLV_SWIG/AtomsolvHelper.i [new file with mode: 0644]
src/ATOMSOLV_SWIG/CMakeLists.txt [new file with mode: 0644]
src/CMakeLists.txt

index 95f8d64fa19fd378ab59e8f2005cef92941e13b5..3be6dac942be092f2f1538870c2233a88e232b0a 100644 (file)
@@ -75,6 +75,7 @@ FIND_PACKAGE(SalomePythonLibs REQUIRED)
 FIND_PACKAGE(SalomeOmniORB REQUIRED)
 FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
 FIND_PACKAGE(SalomePThread REQUIRED)
+FIND_PACKAGE(SalomeSWIG REQUIRED)
 
 # Find GUI
 # ===========
index 3e18cdf2c11ec43a3d8b940b7844a06d687ad040..395889db55e6712b8a73bceddae839ea6f2b134f 100644 (file)
@@ -33,4 +33,5 @@ INSTALL(FILES ${ATOMSOLV_RESOURCES_FILES} DESTINATION ${SALOME_ATOMSOLV_INSTALL_
 
 MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml")
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml @ONLY)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml DESTINATION ${SALOME_ATOMSOLV_INSTALL_RES_DATA})
\ No newline at end of file
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml DESTINATION ${SALOME_ATOMSOLV_INSTALL_RES_DATA})
+SALOME_CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeAppSL.xml INSTALL ${SALOME_ATOMSOLV_INSTALL_RES_DATA})
index 9149fa2cc081ae75285a6070b05ba04899b56932..89311046dc1f9f28478dc00da3823df51ff0bc39 100644 (file)
 using namespace std;
 
 
-ATOMSOLV::ATOMSOLV(CORBA::ORB_ptr orb,
+ATOMSOLV_Abstract::ATOMSOLV_Abstract(CORBA::ORB_ptr orb,
        PortableServer::POA_ptr poa,
        PortableServer::ObjectId * contId, 
        const char *instanceName, 
-       const char *interfaceName) :
-  Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
+       const char *interfaceName,
+  bool withRegistry) :
+  Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, withRegistry)
 {
   MESSAGE("activate object");
   _thisObj = this ;
@@ -39,11 +40,11 @@ ATOMSOLV::ATOMSOLV(CORBA::ORB_ptr orb,
   myData = new ATOMSOLV_ORB::TMoleculeList();
 }
 
-ATOMSOLV::~ATOMSOLV()
+ATOMSOLV_Abstract::~ATOMSOLV_Abstract()
 {
 }
 
-CORBA::Boolean ATOMSOLV::setData( const ATOMSOLV_ORB::TMoleculeList& theData )
+CORBA::Boolean ATOMSOLV_Abstract::setData( const ATOMSOLV_ORB::TMoleculeList& theData )
 {
   const int n = theData.length();
   ATOMSOLV_ORB::TMoleculeList_var data = new ATOMSOLV_ORB::TMoleculeList();
@@ -57,10 +58,10 @@ CORBA::Boolean ATOMSOLV::setData( const ATOMSOLV_ORB::TMoleculeList& theData )
   return (bool)n;
 }
 
-CORBA::Boolean ATOMSOLV::getData( ATOMSOLV_ORB::TMoleculeList_out outData )
+CORBA::Boolean ATOMSOLV_Abstract::getData( ATOMSOLV_ORB::TMoleculeList_out outData )
 {
   ATOMSOLV_ORB::TMoleculeList* data = myData;
-  //    printf( " -- ATOMSOLV::getData() length = %d\n", data->length() );
+  //    printf( " -- ATOMSOLV_Abstract::getData() length = %d\n", data->length() );
   const int n = data->length();
   outData = new ATOMSOLV_ORB::TMoleculeList();
   outData->length( n );
@@ -69,7 +70,7 @@ CORBA::Boolean ATOMSOLV::getData( ATOMSOLV_ORB::TMoleculeList_out outData )
   return true;
 }
 
-CORBA::Boolean ATOMSOLV::processData()
+CORBA::Boolean ATOMSOLV_Abstract::processData()
 {
   ATOMSOLV_ORB::TMoleculeList* data = myData;
   for ( int i = 0, n = data->length(); i < n; i++ )
@@ -77,7 +78,7 @@ CORBA::Boolean ATOMSOLV::processData()
   return true;
 }
 
-char* ATOMSOLV::getVersion()
+char* ATOMSOLV_Abstract::getVersion()
 {
 #if defined(ATOMSOLV_DEVELOPMENT)
   return CORBA::string_dup(ATOMSOLV_VERSION_STR"dev");
@@ -97,8 +98,8 @@ extern "C"
   {
     MESSAGE("PortableServer::ObjectId * ATOMSOLVEngine_factory()");
     SCRUTE(interfaceName);
-    ATOMSOLV * myATOMSOLV 
-      = new ATOMSOLV(orb, poa, contId, instanceName, interfaceName);
+    ATOMSOLV_Session * myATOMSOLV 
+      = new ATOMSOLV_Session(orb, poa, contId, instanceName, interfaceName);
     return myATOMSOLV->getId() ;
   }
 }
index 863b0307a27b1a76226c5fef81d2b631b39d1d01..4d3214276a0ecf29b9f621a5651de53b4a24b467 100644 (file)
 #endif
 
 
-class ATOMSOLV_EXPORT ATOMSOLV:
+class ATOMSOLV_EXPORT ATOMSOLV_Abstract:
   public POA_ATOMSOLV_ORB::ATOMSOLV_Gen,
   public Engines_Component_i 
 {
 
 public:
-  ATOMSOLV(CORBA::ORB_ptr orb,
+  ATOMSOLV_Abstract(CORBA::ORB_ptr orb,
           PortableServer::POA_ptr poa,
           PortableServer::ObjectId * contId, 
           const char *instanceName, 
-          const char *interfaceName);
-  virtual ~ATOMSOLV();
+          const char *interfaceName,
+     bool withRegistry = true);
+  virtual ~ATOMSOLV_Abstract();
 
   CORBA::Boolean setData( const ATOMSOLV_ORB::TMoleculeList& theData );
   CORBA::Boolean getData( ATOMSOLV_ORB::TMoleculeList_out outData );
@@ -60,6 +61,26 @@ private:
   ATOMSOLV_ORB::TMoleculeList* myData;
 };
 
+class ATOMSOLV_EXPORT ATOMSOLV_Session : public ATOMSOLV_Abstract
+{
+public:
+  ATOMSOLV_Session( CORBA::ORB_ptr orb,
+        PortableServer::POA_ptr poa,
+        PortableServer::ObjectId* contId, 
+        const char* instanceName, 
+        const char* interfaceName):ATOMSOLV_Abstract(orb,poa,contId,instanceName,interfaceName,true) { }
+};
+
+class ATOMSOLV_EXPORT ATOMSOLV_No_Session : public ATOMSOLV_Abstract
+{
+public:
+  ATOMSOLV_No_Session( CORBA::ORB_ptr orb,
+        PortableServer::POA_ptr poa,
+        PortableServer::ObjectId* contId, 
+        const char* instanceName, 
+        const char* interfaceName):ATOMSOLV_Abstract(orb,poa,contId,instanceName,interfaceName,false) { }
+};
+
 extern "C"
  ATOMSOLV_EXPORT
 PortableServer::ObjectId * ATOMSOLVEngine_factory(CORBA::ORB_ptr orb,
diff --git a/src/ATOMSOLV/ATOMSOLV_Component_Generator.cxx b/src/ATOMSOLV/ATOMSOLV_Component_Generator.cxx
new file mode 100644 (file)
index 0000000..188c20f
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright (C) 2021  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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// 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
+//
+
+#include "ATOMSOLV_Component_Generator.hxx"
+
+#include "ATOMSOLV.hxx"
+#include "SALOME_Container_i.hxx"
+#include "SALOME_KernelServices.hxx"
+
+#include <cstring>
+
+static Engines::EngineComponent_var _unique_compo;
+
+Engines::EngineComponent_var RetrieveATOMSOLVInstance()
+{
+  constexpr char COMPO_NAME[]="ATOMSOLV";
+  if (CORBA::is_nil(_unique_compo))
+  {
+    CORBA::ORB_var orb;
+    {
+      int argc(0);
+      orb = CORBA::ORB_init(argc, nullptr);
+    }
+    CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
+    PortableServer::POAManager_var pman = poa->the_POAManager();
+    CORBA::PolicyList policies;
+    policies.length(0);
+    auto *cont(KERNEL::getContainerSA());
+    PortableServer::ObjectId *conId(cont->getCORBAId());
+    //
+    pman->activate();
+    //
+    ATOMSOLV_No_Session *servant = new ATOMSOLV_No_Session(orb, poa, conId, "ATOMSOLV_inst_2", COMPO_NAME);
+    PortableServer::ObjectId *zeId = servant->getId();
+    CORBA::Object_var zeRef = poa->id_to_reference(*zeId);
+    KERNEL::RegisterCompo(COMPO_NAME,zeRef);
+    _unique_compo = Engines::EngineComponent::_narrow(zeRef);
+  }
+  return _unique_compo;
+}
diff --git a/src/ATOMSOLV/ATOMSOLV_Component_Generator.hxx b/src/ATOMSOLV/ATOMSOLV_Component_Generator.hxx
new file mode 100644 (file)
index 0000000..46ede1b
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright (C) 2021  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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// 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
+//
+
+#pragma once
+
+#include "ATOMSOLV.hxx"
+
+#include "SALOMEconfig.h"
+
+#include CORBA_SERVER_HEADER(ATOMSOLV)
+
+ATOMSOLV_EXPORT Engines::EngineComponent_var RetrieveATOMSOLVInstance();
index 9ba740df8c0eeaaca3ad425a3d7b4bcc53431679..c2a31e2225387ea18d563c11f2ca73cdc6709259 100644 (file)
@@ -38,6 +38,7 @@ ADD_DEFINITIONS(
 SET(_link_LIBRARIES
   ${ATOMGEN_SalomeIDLATOMGEN}
   ${KERNEL_SalomeContainer}
+  ${KERNEL_SalomeKernelHelpers}
   SalomeIDLATOMSOLV
 )
 
@@ -46,6 +47,7 @@ SET(_link_LIBRARIES
 # header files / no moc processing
 SET(ATOMSOLV_HEADERS
   ATOMSOLV.hxx
+  ATOMSOLV_Component_Generator.hxx
 )
 
 # --- sources ---
@@ -53,6 +55,7 @@ SET(ATOMSOLV_HEADERS
 # sources / static
 SET(ATOMSOLV_SOURCES
   ATOMSOLV.cxx
+  ATOMSOLV_Component_Generator.cxx
 )
 
 # --- rules ---
index fa0cefaf518a7a8192d072aa837675edea4d128d..3206e8f48a3c6a9b44e183cad40f9e558f2644dd 100644 (file)
@@ -22,6 +22,7 @@
 #include "ATOMSOLVGUI_Displayer.h"
 #include "ATOMSOLVGUI_Selection.h"
 #include "ATOMSOLVGUI_TransparencyDlg.h"
+#include "ATOMSOLV_Component_Generator.hxx"
 
 #include <ATOMSOLV_version.h>
 
@@ -36,6 +37,9 @@
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
 
+#include "SALOME_NamingService_Abstract.hxx"
+#include "SALOME_KernelServices.hxx"
+
 #include <LightApp_DataOwner.h>
 #include <LightApp_SelectionMgr.h>
 #include <LightApp_Preferences.h>
@@ -72,7 +76,18 @@ void ATOMSOLVGUI::InitATOMSOLVGen( SalomeApp_Application* app )
   if ( !app )
     myEngine = ATOMSOLV_ORB::ATOMSOLV_Gen::_nil();
   else {
-    Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer", "ATOMSOLV" );
+    SALOME_NamingService_Abstract *ns = SalomeApp_Application::namingService();
+    Engines::EngineComponent_var comp;
+    if(ns->IsTrueNS())
+    {
+      comp = app->lcc()->FindOrLoad_Component( "FactoryServer", "ATOMSOLV" );
+    }
+    else
+    {
+      comp = RetrieveATOMSOLVInstance();
+      CORBA::Object_var comp2 = CORBA::Object::_narrow(comp);
+      KERNEL::RegisterCompo("ATOMSOLV",comp2);
+    }
     ATOMSOLV_ORB::ATOMSOLV_Gen_ptr atomGen = ATOMSOLV_ORB::ATOMSOLV_Gen::_narrow(comp);
     ASSERT( !CORBA::is_nil( atomGen ) );
     myEngine = atomGen;
@@ -256,7 +271,7 @@ void ATOMSOLVGUI::OnRetrieveData()
   ATOMSOLV_ORB::ATOMSOLV_Gen_var engine = GetATOMSOLVGen();
   SalomeApp_Application* app = getApp();
   if ( !CORBA::is_nil( engine ) && app ) {
-    Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServerPy","ATOMGEN" );
+    Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer","ATOMGEN" );
     ATOMGEN_ORB::ATOMGEN_Gen_var atomGen = ATOMGEN_ORB::ATOMGEN_Gen::_narrow( comp );
     SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
     if ( !CORBA::is_nil( atomGen ) && appStudy ) {
index 5d74ec5023835ddc2cdfbc029b2e270da5756f6c..460aa1195ca0ce0e195e354f2ddd399c6e6818ed 100644 (file)
@@ -31,6 +31,7 @@ INCLUDE_DIRECTORIES(
   ${OMNIORB_INCLUDE_DIR}
   ${PROJECT_BINARY_DIR}
   ${PROJECT_BINARY_DIR}/idl
+  ${CMAKE_CURRENT_SOURCE_DIR}/../ATOMSOLV
 )
 
 # additional preprocessor / compiler flags
@@ -46,6 +47,7 @@ SET(_link_LIBRARIES
   ${GUI_LightApp}
   ${GUI_SalomeApp}
   ${ATOMGEN_SalomeIDLATOMGEN}
+  ATOMSOLVEngine
   SalomeIDLATOMSOLV
 )
 
diff --git a/src/ATOMSOLV_SWIG/ATOMSOLV_SalomeSessionless.py b/src/ATOMSOLV_SWIG/ATOMSOLV_SalomeSessionless.py
new file mode 100644 (file)
index 0000000..769415d
--- /dev/null
@@ -0,0 +1,28 @@
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2021  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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# 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
+#
+
+def buildInstance(orb):
+    import AtomsolvHelper
+    atomsolv_ior = AtomsolvHelper.BuildATOMSOLVInstance()
+    import ATOMSOLV_ORB
+    import CORBA
+    orb=CORBA.ORB_init([''])
+    atomsolv = orb.string_to_object(atomsolv_ior)
+    return atomsolv, orb
diff --git a/src/ATOMSOLV_SWIG/AtomsolvHelper.cxx b/src/ATOMSOLV_SWIG/AtomsolvHelper.cxx
new file mode 100644 (file)
index 0000000..2cd6aa4
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (C) 2021  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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// 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
+//
+
+#include "AtomsolvHelper.h"
+
+#include "SALOME_KernelServices.hxx"
+
+#include "ATOMSOLV_Component_Generator.hxx"
+
+std::string BuildATOMSOLVInstance()
+{
+  Engines::EngineComponent_var zeRef = RetrieveATOMSOLVInstance();
+  CORBA::String_var ior = KERNEL::getORB()->object_to_string(zeRef);
+  return std::string(ior.in());
+}
diff --git a/src/ATOMSOLV_SWIG/AtomsolvHelper.h b/src/ATOMSOLV_SWIG/AtomsolvHelper.h
new file mode 100644 (file)
index 0000000..357c293
--- /dev/null
@@ -0,0 +1,22 @@
+// Copyright (C) 2021  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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// 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
+//
+
+#include <string>
+
+std::string BuildATOMSOLVInstance();
diff --git a/src/ATOMSOLV_SWIG/AtomsolvHelper.i b/src/ATOMSOLV_SWIG/AtomsolvHelper.i
new file mode 100644 (file)
index 0000000..8da221b
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (C) 2021  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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// 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
+//
+
+%module AtomsolvHelper
+
+%include "std_string.i"
+
+%inline
+{
+  std::string BuildATOMSOLVInstance();
+}
diff --git a/src/ATOMSOLV_SWIG/CMakeLists.txt b/src/ATOMSOLV_SWIG/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e96f672
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright (C) 2012-2021  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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# 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
+#
+
+include(${SWIG_USE_FILE})
+
+include_directories(
+  ${KERNEL_INCLUDE_DIRS}
+  ${PROJECT_BINARY_DIR}/idl
+  ${PROJECT_SOURCE_DIR}/src/ATOMSOLV
+)
+
+SET(_bin_SCRIPTS
+  ATOMSOLV_SalomeSessionless.py
+)
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}  )
+
+# SWIG wrapping
+SET(AtomsolvHelper_HEADERS AtomsolvHelper.h AtomsolvHelper.i)
+SET(AtomsolvHelper_SOURCES AtomsolvHelper.cxx ${AtomsolvHelper_HEADERS})
+SET_SOURCE_FILES_PROPERTIES(AtomsolvHelper.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(AtomsolvHelper.i PROPERTIES SWIG_FLAGS "-py3")
+SET_SOURCE_FILES_PROPERTIES(AtomsolvHelper_wrap.cpp PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
+SET(_swig_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/AtomsolvHelper.py )
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
+  SWIG_ADD_MODULE(AtomsolvHelper python ${AtomsolvHelper_SOURCES})
+ELSE()
+  SWIG_ADD_LIBRARY(AtomsolvHelper LANGUAGE python SOURCES ${AtomsolvHelper_SOURCES})
+ENDIF()
+SWIG_LINK_LIBRARIES(AtomsolvHelper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} ATOMSOLVEngine ${KERNEL_SalomeKernelHelpers} ${KERNEL_SalomeDS} )
+SWIG_CHECK_GENERATION(AtomsolvHelper)
+IF(WIN32)
+  SET_TARGET_PROPERTIES(_AtomsolvHelper PROPERTIES DEBUG_OUTPUT_NAME _AtomsolvHelper_d)
+ENDIF(WIN32)
+install(TARGETS _AtomsolvHelper DESTINATION ${SALOME_INSTALL_LIBS})
+install(FILES ${AtomsolvHelper_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
+SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_BINS} EXTRA_DPYS "${SWIG_MODULE_AtomsolvHelper_REAL_NAME}")
+
+SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_PYTHON} DEF_PERMS)
index 36fb22f938093179d56fc7a904a8fd676e8fb323..4dbfe2e2393924d9bd0e62d838e9b87873834a54 100644 (file)
@@ -21,7 +21,7 @@
 # Common packages
 ##
 SET(SUBDIRS_COMMON
-  ATOMSOLV ATOMSOLVGUI
+  ATOMSOLV ATOMSOLVGUI ATOMSOLV_SWIG
 )
 
 SET(SUBDIRS