[Cmake-commits] [cmake-commits] king committed cmFileCommand.cxx 1.117 1.118

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Mar 6 09:15:05 EST 2009


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

Modified Files:
	cmFileCommand.cxx 
Log Message:
ENH: Teach file(REMOVE) how to use relative paths

This teaches the command to interpret relative paths with respect to the
location of the invoking CMakeLists.txt file.  The convention is already
used by most commands and won't change the behavior in script mode.


Index: cmFileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.cxx,v
retrieving revision 1.117
retrieving revision 1.118
diff -C 2 -d -r1.117 -r1.118
*** cmFileCommand.cxx	7 Jan 2009 19:16:34 -0000	1.117
--- cmFileCommand.cxx	6 Mar 2009 14:14:57 -0000	1.118
***************
*** 2186,2196 ****
    for(;i != args.end(); ++i)
      {
!     if(cmSystemTools::FileIsDirectory(i->c_str()) && recurse)
        {
!       cmSystemTools::RemoveADirectory(i->c_str());
        }
      else
        {
!       cmSystemTools::RemoveFile(i->c_str());
        }
      }
--- 2186,2203 ----
    for(;i != args.end(); ++i)
      {
!     std::string fileName = *i;
!     if(!cmsys::SystemTools::FileIsFullPath(fileName.c_str()))
        {
!       fileName = this->Makefile->GetCurrentDirectory();
!       fileName += "/" + *i;
!       }
! 
!     if(cmSystemTools::FileIsDirectory(fileName.c_str()) && recurse)
!       {
!       cmSystemTools::RemoveADirectory(fileName.c_str());
        }
      else
        {
!       cmSystemTools::RemoveFile(fileName.c_str());
        }
      }



More information about the Cmake-commits mailing list