From 74fc5983b953032f343b47f04a9e8a52e714f4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Wed, 3 Oct 2012 16:14:45 +0200 Subject: [PATCH] Ninja: don't pollute current dir when using gui (#13495) --- Source/cmNinjaTargetGenerator.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 612e047eb..8f8ec418a 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -662,9 +662,19 @@ cmNinjaTargetGenerator void cmNinjaTargetGenerator -::EnsureDirectoryExists(const std::string& dir) const +::EnsureDirectoryExists(const std::string& path) const { - cmSystemTools::MakeDirectory(dir.c_str()); + if (cmSystemTools::FileIsFullPath(path.c_str())) + { + cmSystemTools::MakeDirectory(path.c_str()); + } + else + { + const std::string fullPath = std::string(this->GetGlobalGenerator()-> + GetCMakeInstance()->GetHomeOutputDirectory()) + + "/" + path; + cmSystemTools::MakeDirectory(fullPath.c_str()); + } } void