From e374376aa60a71c317a2b9f0d0b8ad2ce8e7fbde Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 24 Jan 2020 14:04:11 +0300 Subject: [PATCH] bos #18641 [CEA 18636][Windows] SMESH_MeshersList environment variable separator --- bin/smesh_setenv.py | 2 +- src/SMESH/SMESH_Gen.cxx | 9 ++++++++- src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx | 4 +++- src/SMESH_SWIG/smeshBuilder.py | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/bin/smesh_setenv.py b/bin/smesh_setenv.py index 1500621f8..dc0f918dc 100644 --- a/bin/smesh_setenv.py +++ b/bin/smesh_setenv.py @@ -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) diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 1e9c1471a..9c34d8a02 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -56,6 +56,13 @@ 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 diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index d752566db..2660647d3 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -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"), diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index e843ff168..69c4024e9 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -7628,7 +7628,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 """