[cmake-commits] alex committed cmGetTargetPropertyCommand.cxx 1.8 1.9

cmake-commits at cmake.org cmake-commits at cmake.org
Thu May 31 12:03:54 EDT 2007


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

Modified Files:
	cmGetTargetPropertyCommand.cxx 
Log Message:

ENH: if get_target_property() doesn't find a target with the given name, it
returns now "<NAME_OF_VAR>-NOTFOUND" instead of just "NOTFOUND", which can help
in finding problems

Alex


Index: cmGetTargetPropertyCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGetTargetPropertyCommand.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cmGetTargetPropertyCommand.cxx	22 May 2007 14:24:59 -0000	1.8
+++ cmGetTargetPropertyCommand.cxx	31 May 2007 16:03:52 -0000	1.9
@@ -25,7 +25,7 @@
     this->SetError("called with incorrect number of arguments");
     return false;
     }
-  const char* var = args[0].c_str();
+  std::string var = args[0].c_str();
   const char* targetName = args[1].c_str();
 
   cmTarget *tgt = this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
@@ -36,11 +36,11 @@
     const char *prop = target.GetProperty(args[2].c_str());
     if (prop)
       {
-      this->Makefile->AddDefinition(var, prop);
+      this->Makefile->AddDefinition(var.c_str(), prop);
       return true;
       }
     }
-  this->Makefile->AddDefinition(var, "NOTFOUND");
+  this->Makefile->AddDefinition(var.c_str(), (var+"-NOTFOUND").c_str());
   return true;
 }
 



More information about the Cmake-commits mailing list