diff options
-rw-r--r-- | Source/cmExportLibraryDependencies.cxx | 7 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 84 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 7 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 5 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.h | 7 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 4 | ||||
-rw-r--r-- | Source/cmMakefile.h | 3 | ||||
-rw-r--r-- | Source/cmTryCompileCommand.cxx | 5 | ||||
-rw-r--r-- | Source/cmTryRunCommand.cxx | 5 | ||||
-rw-r--r-- | Source/cmake.cxx | 105 | ||||
-rw-r--r-- | Source/cmake.h | 10 |
11 files changed, 56 insertions, 186 deletions
diff --git a/Source/cmExportLibraryDependencies.cxx b/Source/cmExportLibraryDependencies.cxx index 16537a4882..78a9485a2b 100644 --- a/Source/cmExportLibraryDependencies.cxx +++ b/Source/cmExportLibraryDependencies.cxx @@ -45,13 +45,6 @@ bool cmExportLibraryDependenciesCommand::InitialPass(std::vector<std::string> co void cmExportLibraryDependenciesCommand::FinalPass() { - // don't do anything if local mode - if(m_Makefile->GetLocal()) - { - return; - } - - // Create a full path filename for output std::string fname = m_Args[0]; bool append = false; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 66b54cac57..66c5b79911 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -108,13 +108,8 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, cmSystemTools::SetFatalErrorOccured(); return; } - // setup some variables for the EnableLanguage function - bool isLocal = m_CMakeInstance->GetLocal(); - // if we are from the top, always define this - if(!isLocal) - { - mf->AddDefinition("RUN_CONFIGURE", true); - } + + mf->AddDefinition("RUN_CONFIGURE", true); bool needTestLanguage = false; std::string rootBin = mf->GetHomeOutputDirectory(); // If the configuration files path has been set, @@ -168,7 +163,7 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, } // **** Step 2, Load the CMakeDetermineSystem.cmake file and find out // what platform we are running on - if (!isLocal && !mf->GetDefinition("CMAKE_SYSTEM_NAME")) + if (!mf->GetDefinition("CMAKE_SYSTEM_NAME")) { #if defined(_WIN32) && !defined(__CYGWIN__) /* Windows version number data. */ @@ -200,7 +195,7 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, l != languages.end(); ++l) { const char* lang = l->c_str(); - if(!isLocal && !this->GetLanguageEnabled(lang) ) + if(!this->GetLanguageEnabled(lang) ) { if (m_CMakeInstance->GetIsInTryCompile()) { @@ -322,39 +317,36 @@ void cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, // **** Step 7, Test the compiler for the language just setup // At this point we should have enough info for a try compile // which is used in the backward stuff - if(!isLocal) + if(needTestLanguage) { - if(needTestLanguage) + if (!m_CMakeInstance->GetIsInTryCompile()) { - if (!m_CMakeInstance->GetIsInTryCompile()) + std::string testLang = "CMakeTest"; + testLang += lang; + testLang += "Compiler.cmake"; + std::string ifpath = mf->GetModulesFile(testLang.c_str()); + if(!mf->ReadListFile(0,ifpath.c_str())) { - std::string testLang = "CMakeTest"; - testLang += lang; - testLang += "Compiler.cmake"; - std::string ifpath = mf->GetModulesFile(testLang.c_str()); - if(!mf->ReadListFile(0,ifpath.c_str())) + cmSystemTools::Error("Could not find cmake module file:", ifpath.c_str()); + } + // **** Step 8, load backwards compatibility stuff for C and CXX + // for old versions of CMake ListFiles C and CXX had some + // backwards compatibility files they have to load + const char* versionValue + = mf->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); + if (atof(versionValue) <= 1.4) + { + if(strcmp(lang, "C") == 0) { - cmSystemTools::Error("Could not find cmake module file:", ifpath.c_str()); + ifpath = mf->GetModulesFile("CMakeBackwardCompatibilityC.cmake"); + mf->ReadListFile(0,ifpath.c_str()); } - // **** Step 8, load backwards compatibility stuff for C and CXX - // for old versions of CMake ListFiles C and CXX had some - // backwards compatibility files they have to load - const char* versionValue - = mf->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); - if (atof(versionValue) <= 1.4) + if(strcmp(lang, "CXX") == 0) { - if(strcmp(lang, "C") == 0) - { - ifpath = mf->GetModulesFile("CMakeBackwardCompatibilityC.cmake"); - mf->ReadListFile(0,ifpath.c_str()); - } - if(strcmp(lang, "CXX") == 0) - { - ifpath = mf->GetModulesFile("CMakeBackwardCompatibilityCXX.cmake"); - mf->ReadListFile(0,ifpath.c_str()); - } - + ifpath = mf->GetModulesFile("CMakeBackwardCompatibilityCXX.cmake"); + mf->ReadListFile(0,ifpath.c_str()); } + } } } @@ -634,28 +626,6 @@ void cmGlobalGenerator::Generate() m_CMakeInstance->UpdateProgress("Generating done", -1); } -void cmGlobalGenerator::LocalGenerate() -{ - // for this case we create one LocalGenerator - // configure it, and then Generate it - // start with this directory - cmLocalGenerator *lg = this->CreateLocalGenerator(); - - // Setup relative path generation. - this->ConfigureRelativePaths(); - - // set the Start directories - lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetStartDirectory()); - lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetStartOutputDirectory()); - lg->GetMakefile()->MakeStartDirectoriesCurrent(); - - // now do trhe configure - lg->Configure(); - lg->ConfigureFinalPass(); - lg->Generate(false); - delete lg; -} - int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir, const char *projectName, const char *target, diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 7cce345390..a16b88c2d4 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -61,13 +61,6 @@ public: virtual void Generate(); /** - * Generate the required files for building this directory. This - * basically creates a single LocalGenerators and - * requests that it Generate. - */ - virtual void LocalGenerate(); - - /** * Set/Get and Clear the enabled languages. */ void SetLanguageEnabled(const char*, cmMakefile* mf); diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 2fda9de83f..fb6e8c4d06 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -717,11 +717,6 @@ void cmGlobalVisualStudio7Generator::CreateGUID(const char* name) cmCacheManager::INTERNAL); } -void cmGlobalVisualStudio7Generator::LocalGenerate() -{ - this->cmGlobalGenerator::LocalGenerate(); -} - std::vector<std::string> *cmGlobalVisualStudio7Generator::GetConfigurations() { return &m_Configurations; diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index f4b3d83a94..9a9199cd80 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -67,13 +67,6 @@ public: virtual void Generate(); /** - * Generate the required files for building this directory. This - * basically creates a single LocalGenerators and - * requests that it Generate. - */ - virtual void LocalGenerate(); - - /** * Generate the DSW workspace file. */ virtual void OutputSLNFile(); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index b96201b40e..2acf0df90e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2124,10 +2124,6 @@ cmCacheManager *cmMakefile::GetCacheManager() const return this->GetCMakeInstance()->GetCacheManager(); } -bool cmMakefile::GetLocal() const -{ - return this->GetCMakeInstance()->GetLocal(); -} void cmMakefile::DisplayStatus(const char* message, float s) { this->GetLocalGenerator()->GetGlobalGenerator() diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index dd3c88b0f0..a9f159c0a1 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -610,9 +610,6 @@ public: cmVariableWatch* GetVariableWatch() const; #endif - //! Determine wether this is a local or global build. - bool GetLocal() const; - ///! Display progress or status message. void DisplayStatus(const char*, float); diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index 3972e2a6c1..328c170ff6 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -257,11 +257,6 @@ bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv) return false; } - if ( m_Makefile->GetLocal() ) - { - return true; - } - cmTryCompileCommand::CoreTryCompileCode(m_Makefile,argv,true); return true; diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx index a5d5599210..f668ad96e5 100644 --- a/Source/cmTryRunCommand.cxx +++ b/Source/cmTryRunCommand.cxx @@ -26,11 +26,6 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv) return false; } - if ( m_Makefile->GetLocal() ) - { - return true; - } - // build an arg list for TryCompile and extract the runArgs std::vector<std::string> tryCompile; std::string outputVariable; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bfb62819bf..e09dca82b2 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -115,7 +115,6 @@ cmake::cmake() cmSystemTools::PutEnv("MAKEFLAGS="); } - m_Local = false; m_Verbose = false; m_InTryCompile = false; m_CacheManager = new cmCacheManager; @@ -275,7 +274,6 @@ void cmake::ReadListFile(const char *path) // Parse the args void cmake::SetArgs(const std::vector<std::string>& args) { - m_Local = false; bool directoriesSet = false; for(unsigned int i=1; i < args.size(); ++i) { @@ -363,11 +361,9 @@ void cmake::SetArgs(const std::vector<std::string>& args) this->SetStartDirectory (cmSystemTools::GetCurrentWorkingDirectory().c_str()); } - if (!m_Local) - { - this->SetStartDirectory(this->GetHomeDirectory()); - this->SetStartOutputDirectory(this->GetHomeOutputDirectory()); - } + + this->SetStartDirectory(this->GetHomeDirectory()); + this->SetStartOutputDirectory(this->GetHomeOutputDirectory()); } //---------------------------------------------------------------------------- @@ -1282,49 +1278,36 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure) } int ret = 0; - // 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_ScriptMode || !m_Local || !this->CacheVersionMatches() || - !cmSystemTools::FileExists(systemFile.c_str()) ) - { - // Check the state of the build system to see if we need to regenerate. - if(!this->CheckBuildSystem()) - { - return 0; - } - // If we are doing global generate, we better set start and start - // output directory to the root of the project. - std::string oldstartdir = this->GetStartDirectory(); - std::string oldstartoutputdir = this->GetStartOutputDirectory(); - this->SetStartDirectory(this->GetHomeDirectory()); - this->SetStartOutputDirectory(this->GetHomeOutputDirectory()); - bool saveLocalFlag = m_Local; - m_Local = false; - ret = this->Configure(); - if (ret || m_ScriptMode) - { - return ret; - } - ret = this->Generate(); - std::string message = "Build files have been written to: "; - message += this->GetHomeOutputDirectory(); - this->UpdateProgress(message.c_str(), -1); - if(ret) - { - return ret; - } - m_Local = saveLocalFlag; - this->SetStartDirectory(oldstartdir.c_str()); - this->SetStartOutputDirectory(oldstartoutputdir.c_str()); + // now run the global generate + // Check the state of the build system to see if we need to regenerate. + if(!this->CheckBuildSystem()) + { + return 0; } - - // if we are local do the local thing - if (m_Local) + + // If we are doing global generate, we better set start and start + // output directory to the root of the project. + std::string oldstartdir = this->GetStartDirectory(); + std::string oldstartoutputdir = this->GetStartOutputDirectory(); + this->SetStartDirectory(this->GetHomeDirectory()); + this->SetStartOutputDirectory(this->GetHomeOutputDirectory()); + ret = this->Configure(); + if (ret || m_ScriptMode) { - ret = this->LocalGenerate(); + return ret; } + ret = this->Generate(); + std::string message = "Build files have been written to: "; + message += this->GetHomeOutputDirectory(); + this->UpdateProgress(message.c_str(), -1); + if(ret) + { + return ret; + } + this->SetStartDirectory(oldstartdir.c_str()); + this->SetStartOutputDirectory(oldstartoutputdir.c_str()); + return ret; } @@ -1342,36 +1325,6 @@ int cmake::Generate() return 0; } -int cmake::LocalGenerate() -{ - // Read in the cache - m_CacheManager->LoadCache(this->GetHomeOutputDirectory()); - - // create the generator based on the cache if it isn't already there - const char* genName = m_CacheManager->GetCacheValue("CMAKE_GENERATOR"); - if(genName) - { - m_GlobalGenerator = this->CreateGlobalGenerator(genName); - // set the global flag for unix style paths on cmSystemTools as - // soon as the generator is set. This allows gmake to be used - // on windows. - cmSystemTools::SetForceUnixPaths(m_GlobalGenerator->GetForceUnixPaths()); - } - else - { - cmSystemTools::Error("Could local Generate called without the GENERATOR being specified in the CMakeCache"); - return -1; - } - - // do the local generate - m_GlobalGenerator->LocalGenerate(); - if(cmSystemTools::GetErrorOccuredFlag()) - { - return -1; - } - return 0; -} - unsigned int cmake::GetMajorVersion() { return cmMakefile::GetMajorVersion(); diff --git a/Source/cmake.h b/Source/cmake.h index 50024f7327..ec553bd58e 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -204,12 +204,6 @@ class cmake /** Check if a command exists. */ bool CommandExists(const char* name) const; - /** - * Is cmake in the process of a local cmake invocation. If so, we know the - * cache is already configured and ready to go. - */ - bool GetLocal() { return m_Local; } - ///! Parse command line arguments void SetArgs(const std::vector<std::string>&); @@ -284,9 +278,6 @@ protected: ///! read in a cmake list file to initialize the cache void ReadListFile(const char *path); - ///! used by Run - int LocalGenerate(); - /** * Method called to check build system integrity at build time. * Returns 1 if CMake should rerun and 0 otherwise. @@ -306,7 +297,6 @@ private: ProgressCallback m_ProgressCallback; void* m_ProgressCallbackClientData; bool m_Verbose; - bool m_Local; bool m_InTryCompile; bool m_ScriptMode; std::string m_CMakeCommand; |