[Cmake-commits] [cmake-commits] david.cole committed cmLocalGenerator.cxx 1.315 1.316 cmTarget.cxx 1.271 1.272

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Sep 25 13:23:21 EDT 2009


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

Modified Files:
	cmLocalGenerator.cxx cmTarget.cxx 
Log Message:
Fix CMake Internal Error from cmTarget::GetOutputInfo - triggered by calling GetLocation on a utility target - caused by custom command output file with same name as custom target. The fix is to avoid calling GetLocation unless the target is of a type that is expected to have a location...


Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.315
retrieving revision 1.316
diff -C 2 -d -r1.315 -r1.316
*** cmLocalGenerator.cxx	22 Sep 2009 20:16:55 -0000	1.315
--- cmLocalGenerator.cxx	25 Sep 2009 17:23:18 -0000	1.316
***************
*** 1838,1847 ****
      if(cmSystemTools::FileIsFullPath(inName))
        {
!       std::string tLocation = target->GetLocation(config);
!       tLocation = cmSystemTools::GetFilenamePath(tLocation);
        std::string depLocation = cmSystemTools::GetFilenamePath(
          std::string(inName));
        depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
-       tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str());
        if(depLocation != tLocation)
          {
--- 1838,1852 ----
      if(cmSystemTools::FileIsFullPath(inName))
        {
!       std::string tLocation;
!       if(target->GetType() >= cmTarget::EXECUTABLE && 
!          target->GetType() <= cmTarget::MODULE_LIBRARY)
!         {
!         tLocation = target->GetLocation(config);
!         tLocation = cmSystemTools::GetFilenamePath(tLocation);
!         tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str());
!         }
        std::string depLocation = cmSystemTools::GetFilenamePath(
          std::string(inName));
        depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
        if(depLocation != tLocation)
          {

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.271
retrieving revision 1.272
diff -C 2 -d -r1.271 -r1.272
*** cmTarget.cxx	7 Sep 2009 14:11:42 -0000	1.271
--- cmTarget.cxx	25 Sep 2009 17:23:19 -0000	1.272
***************
*** 1245,1259 ****
      if(cmSystemTools::FileIsFullPath(dep.c_str()))
        {
!       // This is really only for compatibility so we do not need to
!       // worry about configuration names and output names.
!       std::string tLocation = t->GetLocation(0);
!       tLocation = cmSystemTools::GetFilenamePath(tLocation);
!       std::string depLocation = cmSystemTools::GetFilenamePath(dep);
!       depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
!       tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str());
!       if(depLocation == tLocation)
          {
!         this->Target->AddUtility(util.c_str());
!         return true;
          }
        }
--- 1245,1263 ----
      if(cmSystemTools::FileIsFullPath(dep.c_str()))
        {
!       if(t->GetType() >= cmTarget::EXECUTABLE && 
!          t->GetType() <= cmTarget::MODULE_LIBRARY)
          {
!         // This is really only for compatibility so we do not need to
!         // worry about configuration names and output names.
!         std::string tLocation = t->GetLocation(0);
!         tLocation = cmSystemTools::GetFilenamePath(tLocation);
!         std::string depLocation = cmSystemTools::GetFilenamePath(dep);
!         depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
!         tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str());
!         if(depLocation == tLocation)
!           {
!           this->Target->AddUtility(util.c_str());
!           return true;
!           }
          }
        }



More information about the Cmake-commits mailing list