[Cmake-commits] [cmake-commits] alex committed cmGlobalGenerator.cxx 1.233 1.234

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Jun 10 18:28:15 EDT 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv15005

Modified Files:
	cmGlobalGenerator.cxx 
Log Message:
BUG: -fail with error if the CMake<LANG>Information.cmake file wasn't found
ENH: -if no compiler has been found, don't test it, and also remove the compiler
information file again. This makes optionally enabling a language work
better.

Alex


Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.233
retrieving revision 1.234
diff -C 2 -d -r1.233 -r1.234
*** cmGlobalGenerator.cxx	3 Jun 2008 14:02:18 -0000	1.233
--- cmGlobalGenerator.cxx	10 Jun 2008 22:28:01 -0000	1.234
***************
*** 411,420 ****
        fpath +=  lang;
        fpath += "Information.cmake";
!       fpath = mf->GetModulesFile(fpath.c_str());
!       if(!mf->ReadListFile(0,fpath.c_str()))
          {
          cmSystemTools::Error("Could not find cmake module file:",
                               fpath.c_str());
          }
        }
      if (needSetLanguageEnabledMaps[lang])
--- 411,425 ----
        fpath +=  lang;
        fpath += "Information.cmake";
!       std::string informationFile = mf->GetModulesFile(fpath.c_str());
!       if (informationFile.empty())
          {
          cmSystemTools::Error("Could not find cmake module file:",
                               fpath.c_str());
          }
+       else if(!mf->ReadListFile(0, informationFile.c_str()))
+         {
+         cmSystemTools::Error("Could not process cmake module file:",
+                              informationFile.c_str());
+         }
        }
      if (needSetLanguageEnabledMaps[lang])
***************
*** 423,431 ****
        }
  
      // 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 the language is untested then test it now with a try compile.
!     if(needTestLanguage[lang])
        {
        if (!this->CMakeInstance->GetIsInTryCompile())
--- 428,451 ----
        }
  
+     std::string compilerName = "CMAKE_";
+     compilerName += lang;
+     compilerName += "_COMPILER";
+     std::string compilerLangFile = rootBin;
+     compilerLangFile += "/CMake";
+     compilerLangFile += lang;
+     compilerLangFile += "Compiler.cmake";
      // Test the compiler for the language just setup
+     // (but only if a compiler has been actually found)
      // At this point we should have enough info for a try compile
      // which is used in the backward stuff
      // If the language is untested then test it now with a try compile.
!     if (!mf->IsSet(compilerName.c_str()))
!       {
!       // if the compiler did not work, then remove the
!       // CMake(LANG)Compiler.cmake file so that it will get tested the
!       // next time cmake is run
!       cmSystemTools::RemoveFile(compilerLangFile.c_str());
!       }
!     else if(needTestLanguage[lang])
        {
        if (!this->CMakeInstance->GetIsInTryCompile())
***************
*** 448,456 ****
          if(!mf->IsOn(compilerWorks.c_str()))
            {
!           fpath = rootBin;
!           fpath += "/CMake";
!           fpath += lang;
!           fpath += "Compiler.cmake";
!           cmSystemTools::RemoveFile(fpath.c_str());
            }
          else
--- 468,472 ----
          if(!mf->IsOn(compilerWorks.c_str()))
            {
!           cmSystemTools::RemoveFile(compilerLangFile.c_str());
            }
          else



More information about the Cmake-commits mailing list