ENH: Implement PreLoad.cmake feature for CMakeSetup
This commit is contained in:
parent
2dba8e4731
commit
75cf590b21
|
@ -956,6 +956,19 @@ void CMakeSetupDialog::LoadCacheFromDiskToGUI()
|
|||
if(m_WhereBuild != "")
|
||||
{
|
||||
cachem->LoadCache(m_WhereBuild);
|
||||
cmCacheManager::CacheIterator itm = cachem->NewIterator();
|
||||
if ( itm.Find("CMAKE_HOME_DIRECTORY"))
|
||||
{
|
||||
std::string path = ConvertToWindowsPath(itm.GetValue());
|
||||
this->m_WhereSource = path.c_str();
|
||||
this->m_WhereSourceControl.SetWindowText(this->m_WhereSource);
|
||||
this->OnChangeWhereSource();
|
||||
}
|
||||
m_CMakeInstance->SetHomeDirectory(m_WhereSource);
|
||||
m_CMakeInstance->SetStartDirectory(m_WhereSource);
|
||||
m_CMakeInstance->SetHomeOutputDirectory(m_WhereBuild);
|
||||
m_CMakeInstance->SetStartOutputDirectory(m_WhereBuild);
|
||||
m_CMakeInstance->PreLoadCMakeFiles();
|
||||
this->FillCacheGUIFromCacheManager();
|
||||
cmCacheManager::CacheIterator it =
|
||||
cachem->GetCacheIterator("CMAKE_GENERATOR");
|
||||
|
|
|
@ -1182,16 +1182,22 @@ bool cmake::CacheVersionMatches()
|
|||
void cmake::PreLoadCMakeFiles()
|
||||
{
|
||||
std::string pre_load = this->GetHomeDirectory();
|
||||
pre_load += "/PreLoad.cmake";
|
||||
if ( cmSystemTools::FileExists(pre_load.c_str()) )
|
||||
if ( pre_load.size() > 0 )
|
||||
{
|
||||
this->ReadListFile(pre_load.c_str());
|
||||
pre_load += "/PreLoad.cmake";
|
||||
if ( cmSystemTools::FileExists(pre_load.c_str()) )
|
||||
{
|
||||
this->ReadListFile(pre_load.c_str());
|
||||
}
|
||||
}
|
||||
pre_load = this->GetHomeOutputDirectory();
|
||||
pre_load += "/PreLoad.cmake";
|
||||
if ( cmSystemTools::FileExists(pre_load.c_str()) )
|
||||
if ( pre_load.size() > 0 )
|
||||
{
|
||||
this->ReadListFile(pre_load.c_str());
|
||||
pre_load += "/PreLoad.cmake";
|
||||
if ( cmSystemTools::FileExists(pre_load.c_str()) )
|
||||
{
|
||||
this->ReadListFile(pre_load.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue