Fix switching from local to global generation when cmake version changes or when things change inside version
This commit is contained in:
parent
21c0dda8d0
commit
1ac5fb545f
@ -869,11 +869,20 @@ int cmake::Run(const std::vector<std::string>& args)
|
|||||||
// Add any cache args
|
// Add any cache args
|
||||||
this->SetCacheArgs(args);
|
this->SetCacheArgs(args);
|
||||||
|
|
||||||
|
std::string systemFile = this->GetHomeOutputDirectory();
|
||||||
|
systemFile += "/CMakeSystem.cmake";
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
// if not local or the cmake version has changed
|
// if not local or the cmake version has changed since the last run
|
||||||
// since the last run of cmake, run a global generate
|
// of cmake, or CMakeSystem.cmake file is not in the root binary
|
||||||
if(!m_Local || !this->CacheVersionMatches())
|
// 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;
|
bool saveLocalFlag = m_Local;
|
||||||
m_Local = false;
|
m_Local = false;
|
||||||
ret = this->Configure();
|
ret = this->Configure();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user