From 5254822bedb2d18341542fc1947dd2768fbbf068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 23 Feb 2010 21:27:01 +0100 Subject: [PATCH] dmake: generate the lib/lib.pri file --- lib/lib.pri | 3 +-- tools/dmake.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/lib/lib.pri b/lib/lib.pri index 7972cd1eb..24e2ca24e 100644 --- a/lib/lib.pri +++ b/lib/lib.pri @@ -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 \ diff --git a/tools/dmake.cpp b/tools/dmake.cpp index abc2a1d4e..db557f05b 100644 --- a/tools/dmake.cpp +++ b/tools/dmake.cpp @@ -106,6 +106,36 @@ int main() std::vector 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