1 回答

TA貢獻1815條經(jīng)驗 獲得超13個贊
由 qmake 源的代碼來看,它不可能。查過 qmake\generators\win32\msbuild_objectmodel.cpp 在 Qt4.8.5 和Qt5 最新版本,由 qmake 添加唯一屬性表是 Microsoft.Cpp.*.props (各種) 的:
xml << tag("Import")
<< attrTag("Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props")
<< attrTag("Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')")
<< closetag()
<< closetag();
我通過創(chuàng)建快速的 Python 腳本,不會生成的 *.vcxproj 文件上的后期處理解決了此問題:
for l in fileinput.FileInput('Project.vcxproj', inplace=1):
print l,
if 'PropertySheets' in l:
print ' <Import Project="YourPropertySheets.props" />'
當(dāng)然,它將更好地修補 qmake 的新功能,但由于包括你和我都困擾著這個只有三個人,我相信黑客是最佳的解決辦法。
添加回答
舉報