[cmake-commits] king committed cmTarget.cxx 1.103 1.104 cmGetTargetPropertyCommand.h 1.9 1.10

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Sep 29 16:43:03 EDT 2006


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

Modified Files:
	cmTarget.cxx cmGetTargetPropertyCommand.h 
Log Message:
ENH: Added support for getting a target's location on a per-configuration basis (ex. DEBUG_LOCATION).  This does not fix but helps with bug#3250.


Index: cmGetTargetPropertyCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGetTargetPropertyCommand.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmGetTargetPropertyCommand.h	16 Nov 2005 17:11:14 -0000	1.9
+++ cmGetTargetPropertyCommand.h	29 Sep 2006 20:42:58 -0000	1.10
@@ -58,10 +58,17 @@
         "will be set to \"NOTFOUND\".  Use SET_TARGET_PROPERTIES to set "
         "property values.  Properties are usually used to control how "
         "a target is built.\n"
+        "The read-only property \"<CONFIG>_LOCATION\" provides the full "
+        "path to the file on disk that will be created for the target when "
+        "building under configuration <CONFIG> "
+        "(in upper-case, such as \"DEBUG_LOCATION\"). "
         "The read-only property \"LOCATION\" specifies "
         "the full path to the file on disk that will be created for the "
-        "target.  This is very useful for executable targets to get "
-        "the path to the executable file for use in a custom command. "
+        "target. The path may contain a build-system-specific portion that "
+        "is replaced at build time with the configuration getting built "
+        "(such as \"$(ConfigurationName)\" in VS). "
+        "This is very useful for executable targets to get "
+        "the path to the executable file for use in a custom command.\n"
         "The read-only property \"TYPE\" returns which type the specified "
         "target has (EXECUTABLE, STATIC_LIBRARY, SHARED_LIBRARY, "
         "MODULE_LIBRARY, UTILITY, INSTALL_FILES or INSTALL_PROGRAMS). "

Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- cmTarget.cxx	3 Aug 2006 13:42:48 -0000	1.103
+++ cmTarget.cxx	29 Sep 2006 20:42:58 -0000	1.104
@@ -907,7 +907,15 @@
     // variable in the location.
     this->SetProperty("LOCATION", this->GetLocation(0));
     }
-  
+
+  // Per-configuration location can be computed.
+  int len = static_cast<int>(strlen(prop));
+  if(len > 9 && strcmp(prop+len-9, "_LOCATION") == 0)
+    {
+    std::string configName(prop, len-9);
+    this->SetProperty(prop, this->GetLocation(configName.c_str()));
+    }
+
   // the type property returns what type the target is
   if (!strcmp(prop,"TYPE"))
     {



More information about the Cmake-commits mailing list