]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
[EDF22374] : point to mesa libraries in salome_mesa context
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 21 Apr 2021 07:42:38 +0000 (09:42 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 21 Apr 2021 07:42:38 +0000 (09:42 +0200)
bin/salomeContext.py

index 3cfb3808274aa6137b80dcea4b69e1f676329896..e7f6e2b1c1f09d3e32efdd1dd2408cf279b76257 100755 (executable)
@@ -292,6 +292,7 @@ class SalomeContext:
   #
 
   def __setContextFromConfigFile(self, filename, reserved=None):
+    mesa_root_dir = "MESA_ROOT_DIR"
     if reserved is None:
       reserved = []
     try:
@@ -309,6 +310,16 @@ class SalomeContext:
     for var in unsetVars:
       self.unsetVariable(var)
 
+    # mesa stuff
+    if "MESA_GL_VERSION_OVERRIDE" in os.environ:
+      configVarsDict = {k:v for (k,v) in configVars}
+      if mesa_root_dir in configVarsDict:
+        path_to_mesa_lib = os.path.join(configVarsDict[mesa_root_dir],"lib")
+        if os.name == "posix":
+          self.addToVariable("LD_LIBRARY_PATH",path_to_mesa_lib)
+        else:
+          self.addToVariable("PATH",path_to_mesa_lib)
+
     # set context
     for reserved in reservedDict:
       a = [_f for _f in reservedDict[reserved] if _f] # remove empty elements
@@ -320,6 +331,7 @@ class SalomeContext:
         self.addToVariable(reserved, reformattedVals)
       pass
 
+
     for key,val in configVars:
       self.setVariable(key, val, overwrite=True)
       pass