From 957ddc419561b7f1e51efb7b489ffd412aeea847 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Tue, 17 Aug 2004 15:36:08 -0400 Subject: ENH: Move PreLoad.cmake code to public method so that ccmake and CMakeSetup can call it --- Source/cmake.cxx | 31 ++++++++++++++++++------------- Source/cmake.h | 1 + 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 0aca69f..b8e3c24 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1179,6 +1179,22 @@ bool cmake::CacheVersionMatches() 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 int cmake::Run(const std::vector& args, bool noconfigure) { @@ -1205,19 +1221,8 @@ int cmake::Run(const std::vector& args, bool noconfigure) return -1; } - 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()); - } - + this->PreLoadCMakeFiles(); + std::string systemFile = this->GetHomeOutputDirectory(); systemFile += "/CMakeSystem.cmake"; diff --git a/Source/cmake.h b/Source/cmake.h index ccca7bd..7f13f74 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -153,6 +153,7 @@ class cmake * files for the tree. It will not produce any actual Makefiles, or * workspaces. Generate does that. */ int LoadCache(); + void PreLoadCMakeFiles(); ///! Create a GlobalGenerator cmGlobalGenerator* CreateGlobalGenerator(const char* name); -- cgit v0.12