2 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 from setenv import add_path, get_lib_dir, salome_subdir
27 # -----------------------------------------------------------------------------
30 """Add to the PATH-variables modules specific paths"""
32 python_version="python%d.%d" % sys.version_info[0:2]
34 os.environ["SMESH_MeshersList"]="StdMeshers"
35 if not os.environ.has_key("SALOME_StdMeshersResources"):
36 os.environ["SALOME_StdMeshersResources"] \
37 = os.environ["SMESH_ROOT_DIR"]+"/share/"+salome_subdir+"/resources/smesh"
39 if args.has_key("SMESH_plugins"):
40 for plugin in args["SMESH_plugins"]:
42 if os.environ.has_key(plugin+"_ROOT_DIR"):
43 plugin_root = os.environ[plugin+"_ROOT_DIR"]
45 # workaround to avoid modifications of existing environment
46 if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
47 plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
51 os.environ["SMESH_MeshersList"] \
52 = os.environ["SMESH_MeshersList"]+":"+plugin
53 if not os.environ.has_key("SALOME_"+plugin+"Resources"):
54 os.environ["SALOME_"+plugin+"Resources"] \
55 = plugin_root+"/share/"+salome_subdir+"/resources/"+plugin.lower()
56 add_path(os.path.join(plugin_root,get_lib_dir(),python_version, "site-packages",salome_subdir), "PYTHONPATH")
57 add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PYTHONPATH")
59 if sys.platform == "win32":
60 add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "PATH")
62 add_path(os.path.join(plugin_root,get_lib_dir(),salome_subdir), "LD_LIBRARY_PATH")
63 add_path(os.path.join(plugin_root,"bin",salome_subdir), "PYTHONPATH")
64 add_path(os.path.join(plugin_root,"bin",salome_subdir), "PATH")