mirror of
https://bitbucket.org/smil3y/katana.git
synced 2025-02-23 10:22:46 +00:00
automoc.py: set proper type prefix for match
This commit is contained in:
parent
7e804f81d8
commit
4aa1acb124
1 changed files with 5 additions and 5 deletions
10
automoc.py
10
automoc.py
|
@ -21,16 +21,16 @@ for sroot, ldirs, lfiles in os.walk(directory):
|
||||||
for sfile in lfiles:
|
for sfile in lfiles:
|
||||||
sfull = os.path.join(sroot, sfile)
|
sfull = os.path.join(sroot, sfile)
|
||||||
if sfile.endswith(('.h', '.hh', '.hpp', '.c', '.cc', '.cpp')):
|
if sfile.endswith(('.h', '.hh', '.hpp', '.c', '.cc', '.cpp')):
|
||||||
smatch = re.findall('(\n#include (?:"|<)(.*/)?(.*).moc(?:"|>))', fread(sfull))
|
lmatch = re.findall('(\n#include (?:"|<)(.*/)?(.*).moc(?:"|>))', fread(sfull))
|
||||||
if smatch and not re.findall('Q_OBJECT', fread(sfull)):
|
if lmatch and not re.findall('Q_OBJECT', fread(sfull)):
|
||||||
print('Adjusting moc inclusion of', sfull)
|
print('Adjusting moc inclusion of', sfull)
|
||||||
for match in smatch:
|
for match in lmatch:
|
||||||
fwrite(sfull, fread(sfull).replace(match[0], \
|
fwrite(sfull, fread(sfull).replace(match[0], \
|
||||||
'\n#include "%smoc_%s.cpp"' % (match[1], match[2])))
|
'\n#include "%smoc_%s.cpp"' % (match[1], match[2])))
|
||||||
|
|
||||||
elif sfile.endswith('CMakeLists.txt'):
|
elif sfile.endswith('CMakeLists.txt'):
|
||||||
smatch = re.findall('(automoc4_add_library)', fread(sfull))
|
lmatch = re.findall('(automoc4_add_library)', fread(sfull))
|
||||||
if smatch:
|
if lmatch:
|
||||||
print('Adjusting automoc4_add_library of', sfull)
|
print('Adjusting automoc4_add_library of', sfull)
|
||||||
fwrite(sfull, fread(sfull).replace('\nautomoc4_add_library', '\nadd_library'))
|
fwrite(sfull, fread(sfull).replace('\nautomoc4_add_library', '\nadd_library'))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue