diff options
author | Nicolas Despres <nicolas.despres@gmail.com> | 2016-05-13 23:18:20 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-17 13:34:12 (GMT) |
commit | 8a862a4d4b852c9f61ae4ed7fc46042b00a83123 (patch) | |
tree | 591906a0300c9619e57394105455d93126dab939 /Source/cmNinjaTargetGenerator.cxx | |
parent | 038e7716e58e4cf79bda6ba72b92814a14978a8f (diff) | |
download | CMake-8a862a4d4b852c9f61ae4ed7fc46042b00a83123.zip CMake-8a862a4d4b852c9f61ae4ed7fc46042b00a83123.tar.gz CMake-8a862a4d4b852c9f61ae4ed7fc46042b00a83123.tar.bz2 |
Ninja: Support embedding of CMake as subninja project
Add a `CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable. When it is set, CMake
generates a `build.ninja` file suitable for embedding into another ninja
project potentially generated by an alien generator.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 994daea..4d58242 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -669,10 +669,12 @@ void cmNinjaTargetGenerator::EnsureDirectoryExists( if (cmSystemTools::FileIsFullPath(path.c_str())) { cmSystemTools::MakeDirectory(path.c_str()); } else { - const std::string fullPath = std::string(this->GetGlobalGenerator() - ->GetCMakeInstance() - ->GetHomeOutputDirectory()) + - "/" + path; + cmGlobalNinjaGenerator* gg = this->GetGlobalGenerator(); + std::string fullPath = + std::string(gg->GetCMakeInstance()->GetHomeOutputDirectory()); + // Also ensures their is a trailing slash. + gg->StripNinjaOutputPathPrefixAsSuffix(fullPath); + fullPath += path; cmSystemTools::MakeDirectory(fullPath.c_str()); } } |