comparison engine/SConscript @ 196:1587ff8fa3a0

* Correct path splitting patch by Beliar :-) * Fixes issues in case you check out the FIFE trunk into a directory called "engine"
author mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
date Sun, 01 Mar 2009 13:46:45 +0000
parents ea04dfe54aae
children 64738befdf3b
comparison
equal deleted inserted replaced
195:13e5be34484e 196:1587ff8fa3a0
123 else: 123 else:
124 newpath = os.path.join('..', '..', '..', '..', 'engine', newpath) 124 newpath = os.path.join('..', '..', '..', '..', 'engine', newpath)
125 retstr.append(tabcount * '\t' + '<File RelativePath="%s"></File>' % newpath.replace('/','\\')) 125 retstr.append(tabcount * '\t' + '<File RelativePath="%s"></File>' % newpath.replace('/','\\'))
126 return '\n'.join(retstr) 126 return '\n'.join(retstr)
127 127
128 vcpaths = [os.path.abspath(str(f)).split('%sengine%s' % (_sep, _sep))[-1] for f in source] 128 vcpaths = [os.path.abspath(str(f)).rsplit('%sengine%s' % (_sep, _sep))[-1] for f in source]
129 xmlstr = get_msvc_repr(create_dict_tree(dict([[p, {}] for p in vcpaths]))) 129 xmlstr = get_msvc_repr(create_dict_tree(dict([[p, {}] for p in vcpaths])))
130 projtxt = open(joinpath(msvcbuildpath, 'engine_template.xml'), 'r').read() 130 projtxt = open(joinpath(msvcbuildpath, 'engine_template.xml'), 'r').read()
131 projtxt = projtxt.replace('__FILE_INSERTION_POINT__', xmlstr) 131 projtxt = projtxt.replace('__FILE_INSERTION_POINT__', xmlstr)
132 132
133 oldprojtxt = '' 133 oldprojtxt = ''
173 else: 173 else:
174 newpath = os.path.join('..', '..', '..', '..', 'engine', newpath) 174 newpath = os.path.join('..', '..', '..', '..', 'engine', newpath)
175 retstr.append(tabcount * '\t' + '<File RelativePath="%s"></File>' % newpath.replace('/','\\')) 175 retstr.append(tabcount * '\t' + '<File RelativePath="%s"></File>' % newpath.replace('/','\\'))
176 return '\n'.join(retstr) 176 return '\n'.join(retstr)
177 177
178 vcpaths = [os.path.abspath(str(f)).split('%sengine%s' % (_sep, _sep))[-1] for f in source] 178 vcpaths = [os.path.abspath(str(f)).rsplit('%sengine%s' % (_sep, _sep))[-1] for f in source]
179 xmlstr = get_msvc_repr(create_dict_tree(dict([[p, {}] for p in vcpaths]))) 179 xmlstr = get_msvc_repr(create_dict_tree(dict([[p, {}] for p in vcpaths])))
180 projtxt = open(joinpath(msvcbuildpath9, 'engine_template.xml'), 'r').read() 180 projtxt = open(joinpath(msvcbuildpath9, 'engine_template.xml'), 'r').read()
181 projtxt = projtxt.replace('__FILE_INSERTION_POINT__', xmlstr) 181 projtxt = projtxt.replace('__FILE_INSERTION_POINT__', xmlstr)
182 182
183 oldprojtxt = '' 183 oldprojtxt = ''
211 <Option compilerVar="CPP"/> 211 <Option compilerVar="CPP"/>
212 <Option target="default"/> 212 <Option target="default"/>
213 </Unit>''' 213 </Unit>'''
214 xmlstr = [] 214 xmlstr = []
215 for f in source: 215 for f in source:
216 newf = os.path.abspath(str(f)).split('%sengine%s' % (_sep, _sep))[-1] 216 newf = os.path.abspath(str(f)).rsplit('%sengine%s' % (_sep, _sep))[-1]
217 newf = newf.replace('/', '\\') 217 newf = newf.replace('/', '\\')
218 if str(f) in headerfiles: 218 if str(f) in headerfiles:
219 xmlstr.append(codeblocksHeaderDef % newf) 219 xmlstr.append(codeblocksHeaderDef % newf)
220 else: 220 else:
221 xmlstr.append(codeblocksCppDef % newf) 221 xmlstr.append(codeblocksCppDef % newf)
244 <Option compilerVar="CPP"/> 244 <Option compilerVar="CPP"/>
245 <Option target="default"/> 245 <Option target="default"/>
246 </Unit>''' 246 </Unit>'''
247 xmlstr = [] 247 xmlstr = []
248 for f in source: 248 for f in source:
249 newf = os.path.abspath(str(f)).split('%sengine%s' % (_sep, _sep))[-1] 249 newf = os.path.abspath(str(f)).rsplit('%sengine%s' % (_sep, _sep))[-1]
250 newf = newf.replace('/', '\\') 250 newf = newf.replace('/', '\\')
251 if str(f) in headerfiles: 251 if str(f) in headerfiles:
252 xmlstr.append(codeblocksHeaderDef % newf) 252 xmlstr.append(codeblocksHeaderDef % newf)
253 else: 253 else:
254 xmlstr.append(codeblocksCppDef % newf) 254 xmlstr.append(codeblocksCppDef % newf)