diff options
Diffstat (limited to 'tools/configure/environment.cpp')
-rw-r--r-- | tools/configure/environment.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index b9af9eca8f..ab622b576a 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -422,6 +422,28 @@ int Environment::execute(QStringList arguments, const QStringList &additionalEnv } /*! + Executes \a command with _popen() and returns the stdout of the command. + + Taken from qmake's system() command. +*/ +QString Environment::execute(const QString &command) +{ + QString output; + FILE *proc = _popen(command.toLatin1().constData(), "r"); + char buff[256]; + while (proc && !feof(proc)) { + int read_in = int(fread(buff, 1, 255, proc)); + if (!read_in) + break; + buff[read_in] = '\0'; + output += buff; + } + if (proc) + _pclose(proc); + return output; +} + +/*! Copies the \a srcDir contents into \a destDir. If \a includeSrcDir is not empty, any files with 'h', 'prf', or 'conf' suffixes |