4 import os.path, platform
6 def set_env(env,prereq_dir,version,forBuild=None):
7 # keep only the first two version numbers
8 version = '.'.join(version.replace('-', '.').split('.')[:2])
10 env.set('PYTHONHOME', prereq_dir)
12 # [CMake KERNEL] Nouveau nom pour PYTHONHOME = PYTHON_ROOT_DIR 22/03/2013
13 env.set('PYTHON_ROOT_DIR', prereq_dir)
14 root = env.get('PYTHON_ROOT_DIR')
16 env.prepend('PATH', root)
17 env.prepend('PATH', os.path.join(root, 'bin'))
20 l.append(os.path.join(root, 'lib'))
21 #l.append(os.path.join(root, 'lib', 'python' + version))
23 if platform.system() == "Windows" :
24 env.prepend('PATH', l)
25 env.set('PYTHON_INCLUDE', os.path.join(root, 'include'))
26 env.prepend('PYTHONPATH', os.path.join(root, 'Lib'))
27 env.prepend('PYTHONPATH', os.path.join(root, 'lib','site-packages'))
29 env.set('PYTHONBIN', os.path.join(root, 'python.exe')) # needed for runSalome.py
31 env.prepend('LD_LIBRARY_PATH', l)
32 env.set('PYTHON_INCLUDE', os.path.join(root, 'include', 'python' + version))
33 env.prepend('PYTHONPATH', os.path.join(root, 'lib', 'python' + version))
34 env.prepend('PYTHONPATH', os.path.join(root, 'lib', 'python' + version, 'site-packages'))
36 env.set('PYTHONBIN', os.path.join(root, 'bin','python')) # needed for runSalome.py
38 env.set('PYTHON_VERSION', version)
41 def set_nativ_env(env):
43 #env.set('PYTHONHOME',"%s.%s" % sys.version_info[0:2])
44 env.set('PYTHON_ROOT_DIR', '/usr')
45 env.set('PYTHON_VERSION', "%s.%s" % sys.version_info[0:2])