sorted_nodes)
self.sorted_product_list=sorted_nodes
+ # store the list of compile time products
+ # they should be added in build env
+ compile_time_products=[]
+ for (pname,pinfo) in all_products_infos:
+ if src.product.product_is_compile_time(pinfo) or\
+ src.product.product_is_compile_and_runtime(pinfo) :
+ compile_time_products.append(pname)
+ self.compile_time_products=compile_time_products
+
def append(self, key, value, sep=os.pathsep):
"""\
"""
if self.for_package:
- self.set("PRODUCT_ROOT_DIR", "out_dir_Path")
+ if src.architecture.is_windows():
+ self.set("PRODUCT_ROOT_DIR", "%out_dir_Path%")
+ else:
+ self.set("PRODUCT_ROOT_DIR", "out_dir_Path")
+
else:
self.cfg.APPLICATION.environ.PRODUCT_ROOT_DIR = src.pyconf.Reference(self.cfg, src.pyconf.DOLLAR, "workdir")
if self.for_package:
+ prod_base_name=os.path.basename(pi.install_dir)
+ if prod_base_name.startswith("config"):
+ # case of a products installed in base. We remove "config-i"
+ prod_base_name=os.path.basename(os.path.dirname(pi.install_dir))
pi.install_dir = os.path.join(
"out_dir_Path",
self.for_package,
- os.path.basename(pi.install_dir))
+ prod_base_name)
if not self.silent:
logger.write(_("Setting environment for %s\n") % product, 4)
self.set_a_product("Python", logger)
self.set_python_libdirs()
+ # for a build environment, add compile time products (like cmake)
+ if self.forBuild :
+ for product in self.compile_time_products:
+ if product == "Python":
+ continue
+ self.set_a_product(product, logger)
+
# The loop on the products
for product in self.sorted_product_list:
if product == "Python":
continue
+ if self.forBuild and product in self.compile_time_products:
+ continue
self.set_a_product(product, logger)
def set_full_environ(self, logger, env_info):
self.set_a_product("Python", logger)
self.set_python_libdirs()
+ # for a build environment, add compile time products (like cmake)
+ if self.forBuild :
+ for product in self.compile_time_products:
+ if product == "Python":
+ continue
+ self.set_a_product(product, logger)
+
# set products
for product in sorted_product_list:
if product == "Python":
continue
+ if self.forBuild and product in self.compile_time_products:
+ continue
self.set_a_product(product, logger)
class FileEnvWriter: