Move wxDir() and phoenixDir() to buildtools.config

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-12-30 21:01:09 +00:00
parent ca4746f13c
commit 78c1a61993
2 changed files with 20 additions and 27 deletions

View File

@@ -121,16 +121,7 @@ class Configuration(object):
self.COMPILER=None
self.WXPLAT2 = None
if os.environ.has_key('WXWIN'):
self.WXDIR = os.environ['WXWIN']
else:
if os.path.exists('../wxWidgets'):
self.WXDIR = '../wxWidgets' # assumes in parallel SVN tree
else:
self.WXDIR = '..' # assumes wxPython is subdir
msg("WARNING: WXWIN not set in environment. Assuming '%s'" % self.WXDIR)
self.WXDIR = wxDir()
self.includes = ['sip/siplib', # to get our version of sip.h
'src', # for any hand-written headers
@@ -578,4 +569,20 @@ def findCmd(cmd):
if os.path.exists(c):
return c
return None
def phoenixDir():
return os.path.abspath(posixjoin(os.path.dirname(__file__), '..'))
def wxDir():
WXWIN = os.environ.get('WXWIN')
if not WXWIN:
for rel in ['../wxWidgets', '../wx', '..']:
path = os.path.join(phoenixDir(), rel)
if path and os.path.exists(path) and os.path.isdir(path):
WXWIN = os.path.abspath(os.path.join(phoenixDir(), rel))
break
assert WXWIN not in [None, '']
return WXWIN