summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-10-09 12:38:12 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-10-09 12:38:12 (GMT)
commit7da986bb6c3cb82a1853420377bb7be5fb581f81 (patch)
tree3635220892bef7a95a91b3bff0de1da06e5f0d86 /Source/cmNinjaTargetGenerator.cxx
parentaa0647ca9c28afb359066819f44eb101e42e8a2f (diff)
parent74fc5983b953032f343b47f04a9e8a52e714f4b2 (diff)
downloadCMake-7da986bb6c3cb82a1853420377bb7be5fb581f81.zip
CMake-7da986bb6c3cb82a1853420377bb7be5fb581f81.tar.gz
CMake-7da986bb6c3cb82a1853420377bb7be5fb581f81.tar.bz2
Merge topic 'ninja-dont-pollute-current-dir'
74fc598 Ninja: don't pollute current dir when using gui (#13495)
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 811ac88..9a9c857 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -670,9 +670,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