]> SALOME platform Git repositories - tools/yacsgen.git/commitdiff
Salome HOME
Fix copy of salome_context.cfg when the application is generated.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Fri, 16 Jun 2017 14:58:58 +0000 (16:58 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Fri, 16 Jun 2017 14:58:58 +0000 (16:58 +0200)
module_generator/gener.py
module_generator/mod_tmpl.py

index d1649380b239350d31c950443bf36f65f728cd55..38a9e90d2ad5b28e6d3a6c0a143c2fcba1ff7a9a 100644 (file)
@@ -925,15 +925,22 @@ ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR})
     #add the generated module
     modules.append('  <module name="%s" path="%s"/>' % (self.module.name, os.path.abspath(self.module.prefix)))
 
-
+    ROOT_SALOME=os.getenv("ROOT_SALOME")
     #try to find a prerequisites file
     prerequisites = self.context.get("prerequisites")
     if not prerequisites:
       #try to find one in rootdir
-      prerequisites = os.path.join(rootdir, "profile%s.sh" % suffix)
+      prerequisites = os.path.join(ROOT_SALOME, "salome_prerequisites.sh")
     if not os.path.exists(prerequisites):
       raise Invalid("Can not create an application : prerequisites file not defined or does not exist")
 
+    salome_context = self.context.get("salome_context")
+    if not salome_context:
+      #try to find one in rootdir
+      salome_context = os.path.join(ROOT_SALOME, "salome_context.cfg")
+    if not os.path.exists(salome_context):
+      raise Invalid("Can not create an application : salome_context file not defined or does not exist")
+
     #add resources catalog if it exists
     resources_spec=""
     if os.path.isfile(resources):
@@ -941,6 +948,7 @@ ENDIF(EXISTS ${MEDCOUPLING_ROOT_DIR})
 
     #create config_appli.xml file
     appli = application.substitute(prerequisites=prerequisites,
+                                   context=salome_context,
                                    modules="\n".join(modules),
                                    resources=resources_spec)
     fil = open(os.path.join(appliname, "config_appli.xml"), 'w')
index 793377ae61076363050a65dda8475945502b0545..3767e529370395f0ca42e1e9dc989d8d8dc9a9ed 100644 (file)
@@ -25,6 +25,7 @@ except:
 application="""
 <application>
 <prerequisites path="${prerequisites}"/>
+<context path="${context}"/>
 ${resources}
 <modules>
 ${modules}