This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  ad0b167ff5bcd149e136bcce75590dd031781ff6 (commit)
       via  75c3d18dd6b356c692c4f105b0df8413a6d3e0e6 (commit)
       via  23409f50f13a337333021b458a42273464100eae (commit)
       via  2e75bf672b0d8e58972f9445a0ef475d21dbe87f (commit)
      from  90df37f1c48e77972033544ea70e7bf05eec5ecd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ad0b167ff5bcd149e136bcce75590dd031781ff6
commit ad0b167ff5bcd149e136bcce75590dd031781ff6
Merge: 90df37f 75c3d18
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Mon May 12 09:25:45 2014 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon May 12 09:25:45 2014 -0400

    Merge topic 'target-property-policy-context' into next
    
    75c3d18d Merge branch 'backport-target-property-policy-context' into 
target-property-policy-context
    23409f50 cmTarget: Evaluate CMP0026 in calling context
    2e75bf67 cmTarget: Drop unused GetProperty signature


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=75c3d18dd6b356c692c4f105b0df8413a6d3e0e6
commit 75c3d18dd6b356c692c4f105b0df8413a6d3e0e6
Merge: 911cc9a 23409f5
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri May 9 13:46:37 2014 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri May 9 13:46:37 2014 -0400

    Merge branch 'backport-target-property-policy-context' into 
target-property-policy-context
    
    Resolve conflicts in favor of our side.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=23409f50f13a337333021b458a42273464100eae
commit 23409f50f13a337333021b458a42273464100eae
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri May 9 10:50:29 2014 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri May 9 11:12:48 2014 -0400

    cmTarget: Evaluate CMP0026 in calling context
    
    This policy should be checked at the call site that tries to access the
    LOCATION property, not the directory scope containing the target.
    Thread the caller context through cmTarget::GetProperty to use for
    checking the policy setting and emitting a diagnostic with proper
    backtrace.
    
    Extend the RunCMake.CMP0026 test with a cross-directory case.

diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 33c43ca..810802a 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -302,7 +302,8 @@ bool cmGetPropertyCommand::HandleTargetMode()
     }
   if(cmTarget* target = this->Makefile->FindTargetToUse(this->Name))
     {
-    return this->StoreResult(target->GetProperty(this->PropertyName.c_str()));
+    return this->StoreResult(target->GetProperty(this->PropertyName.c_str(),
+                                                 this->Makefile));
     }
   else
     {
diff --git a/Source/cmGetTargetPropertyCommand.cxx 
b/Source/cmGetTargetPropertyCommand.cxx
index 4aa49fe..272607e 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -38,7 +38,7 @@ bool cmGetTargetPropertyCommand
   else if(cmTarget* tgt = this->Makefile->FindTargetToUse(targetName))
     {
     cmTarget& target = *tgt;
-    prop = target.GetProperty(args[2].c_str());
+    prop = target.GetProperty(args[2].c_str(), this->Makefile);
     }
   else
     {
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9eb1f63..219560e 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2624,7 +2624,7 @@ const char* cmTarget::GetFeature(const char* feature, 
const char* config) const
 }
 
 //----------------------------------------------------------------------------
-bool cmTarget::HandleLocationPropertyPolicy() const
+bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const
 {
   if (this->IsImported())
     {
@@ -2633,7 +2633,7 @@ bool cmTarget::HandleLocationPropertyPolicy() const
   cmOStringStream e;
   const char *modal = 0;
   cmake::MessageType messageType = cmake::AUTHOR_WARNING;
-  switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0026))
+  switch (context->GetPolicyStatus(cmPolicies::CMP0026))
     {
     case cmPolicies::WARN:
       e << (this->Makefile->GetPolicies()
@@ -2654,7 +2654,7 @@ bool cmTarget::HandleLocationPropertyPolicy() const
       << this->GetName() << "\".  Use the target name directly with "
       "add_custom_command, or use the generator expression $<TARGET_FILE>, "
       "as appropriate.\n";
-    this->Makefile->IssueMessage(messageType, e.str().c_str());
+    context->IssueMessage(messageType, e.str().c_str());
     }
 
   return messageType != cmake::FATAL_ERROR;
@@ -2663,6 +2663,13 @@ bool cmTarget::HandleLocationPropertyPolicy() const
 //----------------------------------------------------------------------------
 const char *cmTarget::GetProperty(const char* prop) const
 {
+  return this->GetProperty(prop, this->Makefile);
+}
+
+//----------------------------------------------------------------------------
+const char *cmTarget::GetProperty(const char* prop,
+                                  cmMakefile* context) const
+{
   if(!prop)
     {
     return 0;
@@ -2674,7 +2681,7 @@ const char *cmTarget::GetProperty(const char* prop) const
     cmOStringStream e;
     e << "INTERFACE_LIBRARY targets may only have whitelisted properties.  "
          "The property \"" << prop << "\" is not allowed.";
-    this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+    context->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
     return 0;
     }
 
@@ -2693,7 +2700,7 @@ const char *cmTarget::GetProperty(const char* prop) const
     {
     if(strcmp(prop,"LOCATION") == 0)
       {
-      if (!this->HandleLocationPropertyPolicy())
+      if (!this->HandleLocationPropertyPolicy(context))
         {
         return 0;
         }
@@ -2714,7 +2721,7 @@ const char *cmTarget::GetProperty(const char* prop) const
     // Support "LOCATION_<CONFIG>".
     if(cmHasLiteralPrefix(prop, "LOCATION_"))
       {
-      if (!this->HandleLocationPropertyPolicy())
+      if (!this->HandleLocationPropertyPolicy(context))
         {
         return 0;
         }
@@ -2729,7 +2736,7 @@ const char *cmTarget::GetProperty(const char* prop) const
       std::string configName(prop, strlen(prop) - 9);
       if(configName != "IMPORTED")
         {
-        if (!this->HandleLocationPropertyPolicy())
+        if (!this->HandleLocationPropertyPolicy(context))
           {
           return 0;
           }
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index a23c601..a305caa 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -257,6 +257,7 @@ public:
   void SetProperty(const char *prop, const char *value);
   void AppendProperty(const char* prop, const char* value,bool asString=false);
   const char *GetProperty(const char *prop) const;
+  const char *GetProperty(const char *prop, cmMakefile* context) const;
   bool GetPropertyAsBool(const char *prop) const;
   void CheckProperty(const char* prop, cmMakefile* context) const;
 
@@ -579,7 +580,7 @@ public:
                             const std::string &compatibilityType) const;
 
 private:
-  bool HandleLocationPropertyPolicy() const;
+  bool HandleLocationPropertyPolicy(cmMakefile* context) const;
 
   // The set of include directories that are marked as system include
   // directories.
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt 
b/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt
new file mode 100644
index 0000000..17a7db0
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-Dir/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(otherlib ../empty.cpp)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt 
b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
index 9b88194..d122c4a 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
@@ -10,3 +10,16 @@ CMake Warning \(dev\) at CMP0026-WARN.cmake:5 
\(get_target_property\):
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
++
+CMake Warning \(dev\) at CMP0026-WARN.cmake:8 \(get_target_property\):
+  Policy CMP0026 is not set: Disallow use of the LOCATION target property.
+  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy
+  command to set the policy and suppress this warning.
+
+  The LOCATION property should not be read from target "otherlib".  Use the
+  target name directly with add_custom_command, or use the generator
+  expression \$<TARGET_FILE>, as appropriate.
+
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake 
b/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake
index 89c5a8a..bfc9203 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake
+++ b/Tests/RunCMake/CMP0026/CMP0026-WARN.cmake
@@ -3,3 +3,6 @@ enable_language(CXX)
 
 add_library(somelib empty.cpp)
 get_target_property(_loc somelib LOCATION)
+
+add_subdirectory(CMP0026-WARN-Dir)
+get_target_property(_loc otherlib LOCATION)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2e75bf672b0d8e58972f9445a0ef475d21dbe87f
commit 2e75bf672b0d8e58972f9445a0ef475d21dbe87f
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri May 9 10:04:23 2014 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Fri May 9 11:06:13 2014 -0400

    cmTarget: Drop unused GetProperty signature
    
    No callers use the second "scope" argument.  Drop this signature and
    hard-code the default parameter value internally.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e2a568b..9eb1f63 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2624,12 +2624,6 @@ const char* cmTarget::GetFeature(const char* feature, 
const char* config) const
 }
 
 //----------------------------------------------------------------------------
-const char *cmTarget::GetProperty(const char* prop) const
-{
-  return this->GetProperty(prop, cmProperty::TARGET);
-}
-
-//----------------------------------------------------------------------------
 bool cmTarget::HandleLocationPropertyPolicy() const
 {
   if (this->IsImported())
@@ -2667,8 +2661,7 @@ bool cmTarget::HandleLocationPropertyPolicy() const
 }
 
 //----------------------------------------------------------------------------
-const char *cmTarget::GetProperty(const char* prop,
-                                  cmProperty::ScopeType scope) const
+const char *cmTarget::GetProperty(const char* prop) const
 {
   if(!prop)
     {
@@ -2857,10 +2850,10 @@ const char *cmTarget::GetProperty(const char* prop,
     }
   bool chain = false;
   const char *retVal =
-    this->Properties.GetPropertyValue(prop, scope, chain);
+    this->Properties.GetPropertyValue(prop, cmProperty::TARGET, chain);
   if (chain)
     {
-    return this->Makefile->GetProperty(prop,scope);
+    return this->Makefile->GetProperty(prop, cmProperty::TARGET);
     }
   return retVal;
 }
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 0e9d682..a23c601 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -257,7 +257,6 @@ public:
   void SetProperty(const char *prop, const char *value);
   void AppendProperty(const char* prop, const char* value,bool asString=false);
   const char *GetProperty(const char *prop) const;
-  const char *GetProperty(const char *prop, cmProperty::ScopeType scope) const;
   bool GetPropertyAsBool(const char *prop) const;
   void CheckProperty(const char* prop, cmMakefile* context) const;
 

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to