From f18aca79a233c71f7a4bc72c9e31de948ba43c31 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Mon, 10 Jan 2011 16:41:56 +0100 Subject: qmake: write and install pkg-config files for mingw Merge-request: 2543 Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/mingw_make.cpp | 3 +++ qmake/generators/win32/winmakefile.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 4717542..2210bf7 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -142,6 +142,9 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t) if(project->first("TEMPLATE") == "app" || project->first("TEMPLATE") == "lib") { + if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib") + writePkgConfigFile(); + if(Option::mkfile::do_stub_makefile) { t << "QMAKE = " << var("QMAKE_QMAKE") << endl; QStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 8cf970e..b7974e8 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -809,6 +809,18 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t) uninst.append("\n\t"); uninst.append("-$(DEL_FILE) \"" + dst_prl + "\""); } + if(project->isActiveConfig("create_pc")) { + QString dst_pc = pkgConfigFileName(false); + if (!dst_pc.isEmpty()) { + dst_pc = filePrefixRoot(root, targetdir + dst_pc); + if(!ret.isEmpty()) + ret += "\n\t"; + ret += "-$(INSTALL_FILE) \"" + pkgConfigFileName(true) + "\" \"" + dst_pc + "\""; + if(!uninst.isEmpty()) + uninst.append("\n\t"); + uninst.append("-$(DEL_FILE) \"" + dst_pc + "\""); + } + } if(project->isActiveConfig("shared") && !project->isActiveConfig("plugin")) { QString lib_target = getLibTarget(); lib_target.remove('"'); -- cgit v0.12