mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-22 16:07:49 +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
|
#endif
|
||||||
|
|
||||||
cmake::cmake(Role role, cmState::Mode mode)
|
cmake::cmake(Role role, cmState::Mode mode)
|
||||||
: FileTimeCache(cm::make_unique<cmFileTimeCache>())
|
: CMakeWorkingDirectory(cmSystemTools::GetCurrentWorkingDirectory())
|
||||||
|
, FileTimeCache(cm::make_unique<cmFileTimeCache>())
|
||||||
#ifndef CMAKE_BOOTSTRAP
|
#ifndef CMAKE_BOOTSTRAP
|
||||||
, VariableWatch(cm::make_unique<cmVariableWatch>())
|
, VariableWatch(cm::make_unique<cmVariableWatch>())
|
||||||
#endif
|
#endif
|
||||||
|
@@ -193,6 +193,14 @@ public:
|
|||||||
std::string const& GetHomeOutputDirectory() const;
|
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.
|
* Handle a command line invocation of cmake.
|
||||||
*/
|
*/
|
||||||
@@ -628,6 +636,7 @@ protected:
|
|||||||
void GenerateGraphViz(const std::string& fileName) const;
|
void GenerateGraphViz(const std::string& fileName) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::string CMakeWorkingDirectory;
|
||||||
ProgressCallbackType ProgressCallback;
|
ProgressCallbackType ProgressCallback;
|
||||||
WorkingMode CurrentWorkingMode = NORMAL_MODE;
|
WorkingMode CurrentWorkingMode = NORMAL_MODE;
|
||||||
bool DebugOutput = false;
|
bool DebugOutput = false;
|
||||||
|
Reference in New Issue
Block a user