ENH: Move PreLoad.cmake code to public method so that ccmake and CMakeSetup can call it

This commit is contained in:
Andy Cedilnik 2004-08-17 15:36:08 -04:00
parent 576041d492
commit 957ddc4195
2 changed files with 19 additions and 13 deletions

View File

@ -1179,6 +1179,22 @@ bool cmake::CacheVersionMatches()
return cacheSameCMake; return cacheSameCMake;
} }
void cmake::PreLoadCMakeFiles()
{
std::string pre_load = this->GetHomeDirectory();
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()) )
{
this->ReadListFile(pre_load.c_str());
}
}
// handle a command line invocation // handle a command line invocation
int cmake::Run(const std::vector<std::string>& args, bool noconfigure) int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
{ {
@ -1205,18 +1221,7 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
return -1; return -1;
} }
std::string pre_load = this->GetHomeDirectory(); this->PreLoadCMakeFiles();
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()) )
{
this->ReadListFile(pre_load.c_str());
}
std::string systemFile = this->GetHomeOutputDirectory(); std::string systemFile = this->GetHomeOutputDirectory();
systemFile += "/CMakeSystem.cmake"; systemFile += "/CMakeSystem.cmake";

View File

@ -153,6 +153,7 @@ class cmake
* files for the tree. It will not produce any actual Makefiles, or * files for the tree. It will not produce any actual Makefiles, or
* workspaces. Generate does that. */ * workspaces. Generate does that. */
int LoadCache(); int LoadCache();
void PreLoadCMakeFiles();
///! Create a GlobalGenerator ///! Create a GlobalGenerator
cmGlobalGenerator* CreateGlobalGenerator(const char* name); cmGlobalGenerator* CreateGlobalGenerator(const char* name);