std::cout << "---------\n" << "RunCommand: " << cmd << '\n' << "---------\n" << std::endl;
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x86
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <iostream>
#include <string>
FILE* PipeOpen(const char* command, const char* type)
{
#if defined (_MSC_VER)
return _popen(command, type);
#else
return popen(command, type);
#endif
}
int PipeClose(FILE* stream)
return _pclose(stream);
return pclose(stream);
std::string RunCommand(const std::string& cmd, bool verbose = false)
FILE* pipe(PipeOpen(cmd.c_str(), "r"));
char buffer[1024];
std::string output = "";
while (!feof(pipe))
if (fgets(buffer, 1024, pipe) != NULL)
output += buffer;
cl.exe