mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 04:24:36 +08:00
class cmake: Store working directory at cmake launch
This commit is contained in:
@@ -157,7 +157,8 @@ static void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/,
|
||||
#endif
|
||||
|
||||
cmake::cmake(Role role, cmState::Mode mode)
|
||||
: FileTimeCache(cm::make_unique<cmFileTimeCache>())
|
||||
: CMakeWorkingDirectory(cmSystemTools::GetCurrentWorkingDirectory())
|
||||
, FileTimeCache(cm::make_unique<cmFileTimeCache>())
|
||||
#ifndef CMAKE_BOOTSTRAP
|
||||
, VariableWatch(cm::make_unique<cmVariableWatch>())
|
||||
#endif
|
||||
|
@@ -193,6 +193,14 @@ public:
|
||||
std::string const& GetHomeOutputDirectory() const;
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Working directory at CMake launch
|
||||
*/
|
||||
std::string const& GetCMakeWorkingDirectory() const
|
||||
{
|
||||
return this->CMakeWorkingDirectory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a command line invocation of cmake.
|
||||
*/
|
||||
@@ -628,6 +636,7 @@ protected:
|
||||
void GenerateGraphViz(const std::string& fileName) const;
|
||||
|
||||
private:
|
||||
std::string CMakeWorkingDirectory;
|
||||
ProgressCallbackType ProgressCallback;
|
||||
WorkingMode CurrentWorkingMode = NORMAL_MODE;
|
||||
bool DebugOutput = false;
|
||||
|
Reference in New Issue
Block a user