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