diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-12-16 17:13:37 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-12-16 17:13:37 (GMT) |
commit | 1ac5fb545f5287f49d6b4a397d69f1a6051be1f3 (patch) | |
tree | 578bb5cc96461191dd4d2a6c53c78cfcbb86a8e9 | |
parent | 21c0dda8d0599c53db4344cd4316654be2bc91e9 (diff) | |
download | CMake-1ac5fb545f5287f49d6b4a397d69f1a6051be1f3.zip CMake-1ac5fb545f5287f49d6b4a397d69f1a6051be1f3.tar.gz CMake-1ac5fb545f5287f49d6b4a397d69f1a6051be1f3.tar.bz2 |
Fix switching from local to global generation when cmake version changes or when things change inside version
-rw-r--r-- | Source/cmake.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index afb9378..1af64c2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -869,11 +869,20 @@ int cmake::Run(const std::vector<std::string>& args) // Add any cache args this->SetCacheArgs(args); + std::string systemFile = this->GetHomeOutputDirectory(); + systemFile += "/CMakeSystem.cmake"; + int ret = 0; - // if not local or the cmake version has changed - // since the last run of cmake, run a global generate - if(!m_Local || !this->CacheVersionMatches()) + // if not local or the cmake version has changed since the last run + // of cmake, or CMakeSystem.cmake file is not in the root binary + // directory, run a global generate + if(!m_Local || !this->CacheVersionMatches() || + !cmSystemTools::FileExists(systemFile.c_str()) ) { + // If we are doing global generate, we better set start and start + // output directory to the root of the project. + this->SetStartDirectory(this->GetHomeDirectory()); + this->SetStartOutputDirectory(this->GetHomeOutputDirectory()); bool saveLocalFlag = m_Local; m_Local = false; ret = this->Configure(); |