[Cmake-commits] [cmake-commits] king committed cmCommandArgumentParserHelper.cxx 1.21 1.22

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Sep 25 10:21:17 EDT 2008


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

Modified Files:
	cmCommandArgumentParserHelper.cxx 
Log Message:
ENH: Create $CACHE{VAR} syntax

This syntax allows reading of cache entries even when variables of the
same name have been defined in the local scope.  See issue #7715.


Index: cmCommandArgumentParserHelper.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCommandArgumentParserHelper.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -C 2 -d -r1.21 -r1.22
*** cmCommandArgumentParserHelper.cxx	24 Sep 2008 12:51:19 -0000	1.21
--- cmCommandArgumentParserHelper.cxx	25 Sep 2008 14:21:14 -0000	1.22
***************
*** 88,94 ****
      return this->EmptyVariable;
      }
    cmOStringStream e;
    e << "Syntax $" << key << "{} is not supported.  "
!     << "Only ${} and ENV{} are allowed.";
    this->SetError(e.str());
    return 0;
--- 88,109 ----
      return this->EmptyVariable;
      }
+   if ( strcmp(key, "CACHE") == 0 )
+     {
+     if(const char* c = this->Makefile->GetCacheManager()->GetCacheValue(var))
+       {
+       if(this->EscapeQuotes)
+         {
+         return this->AddString(cmSystemTools::EscapeQuotes(c).c_str());
+         }
+       else
+         {
+         return this->AddString(c);
+         }
+       }
+     return this->EmptyVariable;
+     }
    cmOStringStream e;
    e << "Syntax $" << key << "{} is not supported.  "
!     << "Only ${}, $ENV{}, and $CACHE{} are allowed.";
    this->SetError(e.str());
    return 0;



More information about the Cmake-commits mailing list