Salome HOME
bos #18641 [CEA 18636][Windows] SMESH_MeshersList environment variable separator rnv/18641
authorrnv <rnv@opencascade.com>
Fri, 24 Jan 2020 11:04:11 +0000 (14:04 +0300)
committerrnv <rnv@opencascade.com>
Fri, 24 Jan 2020 11:04:11 +0000 (14:04 +0300)
bin/smesh_setenv.py
src/SMESH/SMESH_Gen.cxx
src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx
src/SMESH_SWIG/smeshBuilder.py

index 1500621f89fcd61ae835936984d3f23d5c012cf1..dc0f918dc4170c0d4b4acb5585cc517f5b46a82f 100644 (file)
@@ -77,5 +77,5 @@ def set_env(args):
                         pass
                     pass
                 break
-    os.environ["SMESH_MeshersList"] = ":".join(plugin_list)
+    os.environ["SMESH_MeshersList"] = os.pathsep.join(plugin_list)
     os.environ["SalomeAppConfig"] = os.environ["SalomeAppConfig"] + psep + psep.join(resource_path_list)
index 1e9c1471a1e404d52c46ef6385ab35fb437f9ca9..9c34d8a025127a486a8ed41c8ddfc592c5b3d736 100644 (file)
 
 using namespace std;
 
+// Environment variable separator
+#ifdef WIN32
+  #define env_sep ';'
+#else
+  #define env_sep ':'
+#endif
+
 //=============================================================================
 /*!
  *  Constructor
@@ -984,7 +991,7 @@ std::vector< std::string > SMESH_Gen::GetPluginXMLPaths()
     while ( from < meshers.size() )
     {
       // cut off plugin name
-      pos = meshers.find( ':', from );
+      pos = meshers.find( env_sep, from );
       if ( pos != string::npos )
         plugin = meshers.substr( from, pos-from );
       else
index eaaad911c314d9fc2eda03b7dd3382a9b3215cb9..c10fb730a10a4e4f47e75dfe32eb396677684e7f 100644 (file)
@@ -67,6 +67,7 @@
  #define LoadLib( name ) LoadLibrary( name )
  #define GetProc GetProcAddress
  #define UnLoadLib( handle ) FreeLibrary( handle );
+ #define env_sep ";"
 #else // WIN32
  #define LibHandle void*
  #ifdef DYNLOAD_LOCAL
@@ -76,6 +77,7 @@
  #endif // DYNLOAD_LOCAL
  #define GetProc dlsym
  #define UnLoadLib( handle ) dlclose( handle );
+ #define env_sep ":"
 #endif // WIN32
 
 #ifdef _DEBUG_
@@ -197,7 +199,7 @@ namespace SMESH
       if (cenv)
         HypsXml.sprintf("%s", cenv);
 
-      QStringList HypsXmlList = HypsXml.split(":", QString::SkipEmptyParts);
+      QStringList HypsXmlList = HypsXml.split(env_sep, QString::SkipEmptyParts);
       if (HypsXmlList.count() == 0) {
         SUIT_MessageBox::critical(SMESHGUI::desktop(),
                                   QObject::tr("SMESH_WRN_WARNING"),
index df65f685f28da4cca6393f06636cde752b8d74c9..29886293427d603ec5440b2cf263f0e982b37e97 100644 (file)
@@ -7607,7 +7607,7 @@ class genObjUnRegister:
             if genObj and hasattr( genObj, "UnRegister" ):
                 genObj.UnRegister()
 
-for pluginName in os.environ[ "SMESH_MeshersList" ].split( ":" ):
+for pluginName in os.environ[ "SMESH_MeshersList" ].split( os.pathsep ):
     """
     Bind methods creating mesher plug-ins to the Mesh class
     """