dmake: generate the lib/lib.pri file

This commit is contained in:
Daniel Marjamäki 2010-02-23 21:27:01 +01:00
parent 40bb5144e1
commit 5254822bed
2 changed files with 31 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# Common project include with headers and sources
# no manual edits - this file is autogenerated by dmake
HEADERS += $$PWD/check.h \
$$PWD/checkautovariables.h \
@ -11,7 +11,6 @@ HEADERS += $$PWD/check.h \
$$PWD/checkother.h \
$$PWD/checkstl.h \
$$PWD/checkunusedfunctions.h \
$$PWD/classinfo.h \
$$PWD/cppcheck.h \
$$PWD/errorlogger.h \
$$PWD/executionpath.h \

View File

@ -106,6 +106,36 @@ int main()
std::vector<std::string> testfiles;
getCppFiles(testfiles, "test/");
// QMAKE - lib/lib.pri
{
std::ofstream fout1("lib/lib.pri");
if (fout1.is_open())
{
fout1 << "# no manual edits - this file is autogenerated by dmake\n\n";
fout1 << "HEADERS += $$PWD/check.h \\\n";
for (unsigned int i = 0; i < libfiles.size(); ++i)
{
std::string fname(libfiles[i].substr(4));
if (fname.find(".cpp") == std::string::npos)
continue; // shouldn't happen
fname.erase(fname.find(".cpp"));
fout1 << std::string(11,' ') << "$$PWD/" << fname << ".h";
if (i < libfiles.size() - 1)
fout1 << " \\\n";
}
fout1 << "\n\nSOURCES += ";
for (unsigned int i = 0; i < libfiles.size(); ++i)
{
fout1 << "$$PWD/" << libfiles[i].substr(4);
if (i < libfiles.size() - 1)
fout1 << " \\\n" << std::string(11, ' ');
}
fout1 << "\n";
}
}
std::ofstream fout("Makefile");
// more warnings.. -Wfloat-equal -Wcast-qual -Wsign-conversion -Wlogical-op