diff options
author | Brad King <brad.king@kitware.com> | 2015-09-22 17:57:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-22 17:57:08 (GMT) |
commit | 2e6063068c94d4045e699fed51e6d1e9af344bbf (patch) | |
tree | d11025f71134b3238e52655640dcdf2158425597 /Source/cmake.cxx | |
parent | 81739e9215ef10d870f14404b0ec5eb4bee16ce4 (diff) | |
parent | 3bb707f0a1408dc0381ecbf4ec934e9f14d8927c (diff) | |
download | CMake-2e6063068c94d4045e699fed51e6d1e9af344bbf.zip CMake-2e6063068c94d4045e699fed51e6d1e9af344bbf.tar.gz CMake-2e6063068c94d4045e699fed51e6d1e9af344bbf.tar.bz2 |
Merge branch 'improve-variable-help-formatting' into revert-cmake-W-options
Resolve conflicts in
Help/variable/CMAKE_ERROR_DEPRECATED.rst
Help/variable/CMAKE_WARN_DEPRECATED.rst
by integrating changes from both sides.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 9d2c19e..dbbe07d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -75,7 +75,9 @@ # include "cmGlobalWatcomWMakeGenerator.h" #endif #include "cmGlobalUnixMakefileGenerator3.h" -#include "cmGlobalNinjaGenerator.h" +#if defined(CMAKE_BUILD_WITH_CMAKE) +# include "cmGlobalNinjaGenerator.h" +#endif #include "cmExtraCodeLiteGenerator.h" #if !defined(CMAKE_BOOT_MINGW) @@ -1447,7 +1449,7 @@ int cmake::ActualConfigure() } } - cmMakefile* mf=this->GlobalGenerator->GetLocalGenerators()[0]->GetMakefile(); + cmMakefile* mf=this->GlobalGenerator->GetMakefiles()[0]; if (mf->IsOn("CTEST_USE_LAUNCHERS") && !this->State->GetGlobalProperty("RULE_LAUNCH_COMPILE")) { @@ -1607,7 +1609,11 @@ int cmake::Generate() { return -1; } - this->GlobalGenerator->DoGenerate(); + if (!this->GlobalGenerator->Compute()) + { + return -1; + } + this->GlobalGenerator->Generate(); if ( !this->GraphVizFile.empty() ) { std::cout << "Generate graphviz: " << this->GraphVizFile << std::endl; @@ -1696,8 +1702,10 @@ void cmake::AddDefaultGenerators() #endif this->Generators.push_back( cmGlobalUnixMakefileGenerator3::NewFactory()); +#if defined(CMAKE_BUILD_WITH_CMAKE) this->Generators.push_back( cmGlobalNinjaGenerator::NewFactory()); +#endif #if defined(CMAKE_USE_WMAKE) this->Generators.push_back( cmGlobalWatcomWMakeGenerator::NewFactory()); @@ -2576,6 +2584,25 @@ int cmake::Build(const std::string& dir, } std::string cachePath = dir; cmSystemTools::ConvertToUnixSlashes(cachePath); + std::string cacheFile = cachePath; + cacheFile += "/CMakeCache.txt"; + if(!cmSystemTools::FileExists(cacheFile.c_str())) + { + // search in parent directories for cache + std::string cmakeFiles = cachePath; + cmakeFiles += "/CMakeFiles"; + if(cmSystemTools::FileExists(cmakeFiles.c_str())) + { + std::string cachePathFound = + cmSystemTools::FileExistsInParentDirectories( + "CMakeCache.txt", cachePath.c_str(), "/"); + if(!cachePathFound.empty()) + { + cachePath = cmSystemTools::GetFilenamePath(cachePathFound); + } + } + } + if(!this->LoadCache(cachePath)) { std::cerr << "Error: could not load cache\n"; |