1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmProcess.h,v $
6 Date: $Date: 2008-12-29 22:49:17 $
7 Version: $Revision: 1.3 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
21 #include "cmStandardIncludes.h"
22 #include <cmsys/Process.h>
26 * \brief run a process with c++
28 * cmProcess wraps the kwsys process stuff in a c++ class.
35 const char* GetCommand() { return this->Command
.c_str();}
36 void SetCommand(const char* command
);
37 void SetCommandArguments(std::vector
<std::string
> const& arg
);
38 void SetWorkingDirectory(const char* dir
) { this->WorkingDirectory
= dir
;}
39 void SetTimeout(double t
) { this->Timeout
= t
;}
40 // Return true if the process starts
43 // return process state
44 int CheckOutput(double timeout
,
45 std::string
& stdOutLine
,
46 std::string
& stdErrLine
);
47 // return the process status
48 int GetProcessStatus();
49 // return true if the process is running
51 // Report the status of the program
53 int GetId() { return this->Id
; }
54 void SetId(int id
) { this->Id
= id
;}
55 int GetExitValue() { return this->ExitValue
;}
61 cmsysProcess
* Process
;
62 std::vector
<char> StdErrorBuffer
;
63 std::vector
<char> StdOutBuffer
;
65 std::string WorkingDirectory
;
66 std::vector
<std::string
> Arguments
;
67 std::vector
<const char*> ProcessArgs
;