[Cmake-commits] CMake branch, next, updated. v2.8.11.2-2944-g41b9b45

Stephen Kelly steveire at gmail.com
Sun Jul 7 17:48:12 EDT 2013


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  41b9b45729341de3e54993c74a48094bc8227222 (commit)
       via  0a29afa82ce1d105081aa164c6bf843e3ce22d20 (commit)
      from  65a82c1210d6450845e340d3cce504a7d4d0e775 (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=41b9b45729341de3e54993c74a48094bc8227222
commit 41b9b45729341de3e54993c74a48094bc8227222
Merge: 65a82c1 0a29afa
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 7 17:48:10 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jul 7 17:48:10 2013 -0400

    Merge topic 'target-policies' into next
    
    0a29afa Revert "Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICY"


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a29afa82ce1d105081aa164c6bf843e3ce22d20
commit 0a29afa82ce1d105081aa164c6bf843e3ce22d20
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jul 7 23:47:42 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jul 7 23:47:42 2013 +0200

    Revert "Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICY"
    
    This reverts commit 0e9de78bea00a0b74c4737e17f353c28d471e94a.

diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index bc679c0..a02cd88 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -937,13 +937,10 @@ static const struct TargetNameNode : public cmGeneratorExpressionNode
 
 //----------------------------------------------------------------------------
 static const char* targetPolicyWhitelist[] = {
-  0
-#define TARGET_POLICY_STRING(POLICY) \
-  , #POLICY
-
-  CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_STRING)
-
-#undef TARGET_POLICY_STRING
+    "CMP0003"
+  , "CMP0004"
+  , "CMP0008"
+  , "CMP0020"
 };
 
 cmPolicies::PolicyStatus statusForTarget(cmTarget *tgt, const char *policy)
@@ -954,7 +951,10 @@ cmPolicies::PolicyStatus statusForTarget(cmTarget *tgt, const char *policy)
     return tgt->GetPolicyStatus ## POLICY (); \
   } \
 
-  CM_FOR_EACH_TARGET_POLICY(RETURN_POLICY)
+  RETURN_POLICY(CMP0003)
+  RETURN_POLICY(CMP0004)
+  RETURN_POLICY(CMP0008)
+  RETURN_POLICY(CMP0020)
 
 #undef RETURN_POLICY
 
@@ -970,7 +970,10 @@ cmPolicies::PolicyID policyForString(const char *policy_id)
     return cmPolicies:: POLICY_ID; \
   } \
 
-  CM_FOR_EACH_TARGET_POLICY(RETURN_POLICY_ID)
+  RETURN_POLICY_ID(CMP0003)
+  RETURN_POLICY_ID(CMP0004)
+  RETURN_POLICY_ID(CMP0008)
+  RETURN_POLICY_ID(CMP0020)
 
 #undef RETURN_POLICY_ID
 
@@ -1000,7 +1003,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
 
     context->HadContextSensitiveCondition = true;
 
-    for (size_t i = 1;
+    for (size_t i = 0;
          i < (sizeof(targetPolicyWhitelist) /
               sizeof(*targetPolicyWhitelist));
          ++i)
@@ -1026,17 +1029,8 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
       }
     reportError(context, content->GetOriginalExpression(),
       "$<TARGET_POLICY:prop> may only be used with a limited number of "
-      "policies.  Currently it may be used with the following policies:\n"
-
-#define STRINGIFY_HELPER(X) #X
-#define STRINGIFY(X) STRINGIFY_HELPER(X)
-
-#define TARGET_POLICY_LIST_ITEM(POLICY) \
-      " * " STRINGIFY(POLICY) "\n"
-
-      CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_LIST_ITEM)
-
-#undef TARGET_POLICY_LIST_ITEM
+      "policies.  Currently it may be used with policies CMP0003, CMP0004, "
+      "CMP0008 and CMP0020."
       );
     return std::string();
   }
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index bfc1c81..442f86f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -191,14 +191,13 @@ cmTargetInternals::~cmTargetInternals()
 //----------------------------------------------------------------------------
 cmTarget::cmTarget()
 {
-#define INITIALIZE_TARGET_POLICY_MEMBER(POLICY) \
-  this->PolicyStatus ## POLICY = cmPolicies::WARN;
-
-  CM_FOR_EACH_TARGET_POLICY(INITIALIZE_TARGET_POLICY_MEMBER)
-
-#undef INITIALIZE_TARGET_POLICY_MEMBER
-
   this->Makefile = 0;
+  this->PolicyStatusCMP0003 = cmPolicies::WARN;
+  this->PolicyStatusCMP0004 = cmPolicies::WARN;
+  this->PolicyStatusCMP0008 = cmPolicies::WARN;
+  this->PolicyStatusCMP0020 = cmPolicies::WARN;
+  this->PolicyStatusCMP0021 = cmPolicies::WARN;
+  this->PolicyStatusCMP0022 = cmPolicies::WARN;
   this->LinkLibrariesAnalyzed = false;
   this->HaveInstallRule = false;
   this->DLLPlatform = false;
@@ -1693,13 +1692,18 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", 0);
 
   // Record current policies for later use.
-#define CAPTURE_TARGET_POLICY(POLICY) \
-  this->PolicyStatus ## POLICY = \
-    this->Makefile->GetPolicyStatus(cmPolicies::POLICY);
-
-  CM_FOR_EACH_TARGET_POLICY(CAPTURE_TARGET_POLICY)
-
-#undef CAPTURE_TARGET_POLICY
+  this->PolicyStatusCMP0003 =
+    this->Makefile->GetPolicyStatus(cmPolicies::CMP0003);
+  this->PolicyStatusCMP0004 =
+    this->Makefile->GetPolicyStatus(cmPolicies::CMP0004);
+  this->PolicyStatusCMP0008 =
+    this->Makefile->GetPolicyStatus(cmPolicies::CMP0008);
+  this->PolicyStatusCMP0020 =
+    this->Makefile->GetPolicyStatus(cmPolicies::CMP0020);
+  this->PolicyStatusCMP0021 =
+    this->Makefile->GetPolicyStatus(cmPolicies::CMP0021);
+  this->PolicyStatusCMP0022 =
+    this->Makefile->GetPolicyStatus(cmPolicies::CMP0022);
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 273f4e9..d7ee332 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -19,14 +19,6 @@
 
 #include <cmsys/auto_ptr.hxx>
 
-#define CM_FOR_EACH_TARGET_POLICY(F) \
-  F(CMP0003) \
-  F(CMP0004) \
-  F(CMP0008) \
-  F(CMP0020) \
-  F(CMP0021) \
-  F(CMP0022)
-
 class cmake;
 class cmMakefile;
 class cmSourceFile;
@@ -99,13 +91,29 @@ public:
   void SetMakefile(cmMakefile *mf);
   cmMakefile *GetMakefile() const { return this->Makefile;};
 
-#define DECLARE_TARGET_POLICY(POLICY) \
-  cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \
-    { return this->PolicyStatus ## POLICY; }
+  /** Get the status of policy CMP0003 when the target was created.  */
+  cmPolicies::PolicyStatus GetPolicyStatusCMP0003() const
+    { return this->PolicyStatusCMP0003; }
+
+  /** Get the status of policy CMP0004 when the target was created.  */
+  cmPolicies::PolicyStatus GetPolicyStatusCMP0004() const
+    { return this->PolicyStatusCMP0004; }
+
+  /** Get the status of policy CMP0008 when the target was created.  */
+  cmPolicies::PolicyStatus GetPolicyStatusCMP0008() const
+    { return this->PolicyStatusCMP0008; }
 
-  CM_FOR_EACH_TARGET_POLICY(DECLARE_TARGET_POLICY)
+  /** Get the status of policy CMP0020 when the target was created.  */
+  cmPolicies::PolicyStatus GetPolicyStatusCMP0020() const
+    { return this->PolicyStatusCMP0020; }
 
-#undef DECLARE_TARGET_POLICY
+  /** Get the status of policy CMP0021 when the target was created.  */
+  cmPolicies::PolicyStatus GetPolicyStatusCMP0021() const
+    { return this->PolicyStatusCMP0021; }
+
+  /** Get the status of policy CMP0022 when the target was created.  */
+  cmPolicies::PolicyStatus GetPolicyStatusCMP0022() const
+    { return this->PolicyStatusCMP0022; }
 
   /**
    * Get the list of the custom commands for this target
@@ -686,12 +694,12 @@ private:
   cmMakefile* Makefile;
 
   // Policy status recorded when target was created.
-#define TARGET_POLICY_MEMBER(POLICY) \
-  cmPolicies::PolicyStatus PolicyStatus ## POLICY;
-
-  CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_MEMBER)
-
-#undef TARGET_POLICY_MEMBER
+  cmPolicies::PolicyStatus PolicyStatusCMP0003;
+  cmPolicies::PolicyStatus PolicyStatusCMP0004;
+  cmPolicies::PolicyStatus PolicyStatusCMP0008;
+  cmPolicies::PolicyStatus PolicyStatusCMP0020;
+  cmPolicies::PolicyStatus PolicyStatusCMP0021;
+  cmPolicies::PolicyStatus PolicyStatusCMP0022;
 
   // Internal representation details.
   friend class cmTargetInternals;
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 7fd3dba..e07c42f 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -96,7 +96,6 @@ add_RunCMake_test(list)
 add_RunCMake_test(try_compile)
 add_RunCMake_test(variable_watch)
 add_RunCMake_test(CMP0004)
-add_RunCMake_test(TargetPolicies)
 
 find_package(Qt4 QUIET)
 find_package(Qt5Core QUIET)
diff --git a/Tests/RunCMake/TargetPolicies/CMakeLists.txt b/Tests/RunCMake/TargetPolicies/CMakeLists.txt
deleted file mode 100644
index e8db6b0..0000000
--- a/Tests/RunCMake/TargetPolicies/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-project(${RunCMake_TEST} NONE)
-include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-result.txt b/Tests/RunCMake/TargetPolicies/PolicyList-result.txt
deleted file mode 100644
index d00491f..0000000
--- a/Tests/RunCMake/TargetPolicies/PolicyList-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
deleted file mode 100644
index 6e83b09..0000000
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-CMake Error:
-  Error evaluating generator expression:
-
-    \$<TARGET_POLICY:NOT_A_POLICY>
-
-  \$<TARGET_POLICY:prop> may only be used with a limited number of policies.
-  Currently it may be used with the following policies:
-
-   \* CMP0003
-   \* CMP0004
-   \* CMP0008
-   \* CMP0020
-   \* CMP0021
-   \* CMP0022
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList.cmake b/Tests/RunCMake/TargetPolicies/PolicyList.cmake
deleted file mode 100644
index c290b65..0000000
--- a/Tests/RunCMake/TargetPolicies/PolicyList.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-
-enable_language(CXX)
-
-add_library(empty empty.cpp)
-target_compile_definitions(empty
-  PRIVATE
-    $<$<TARGET_POLICY:NOT_A_POLICY>:SOME_DEFINE>
-)
diff --git a/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake b/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake
deleted file mode 100644
index 7a94630..0000000
--- a/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-include(RunCMake)
-
-run_cmake(PolicyList)
diff --git a/Tests/RunCMake/TargetPolicies/empty.cpp b/Tests/RunCMake/TargetPolicies/empty.cpp
deleted file mode 100644
index 7279c5e..0000000
--- a/Tests/RunCMake/TargetPolicies/empty.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
-int empty(void)
-{
-  return 0;
-}

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

Summary of changes:
 Source/cmGeneratorExpressionEvaluator.cxx          |   36 ++++++---------
 Source/cmTarget.cxx                                |   32 ++++++++------
 Source/cmTarget.h                                  |   46 +++++++++++--------
 Tests/RunCMake/CMakeLists.txt                      |    1 -
 Tests/RunCMake/TargetPolicies/CMakeLists.txt       |    3 -
 .../RunCMake/TargetPolicies/PolicyList-result.txt  |    1 -
 .../RunCMake/TargetPolicies/PolicyList-stderr.txt  |   14 ------
 Tests/RunCMake/TargetPolicies/PolicyList.cmake     |    8 ---
 Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake   |    3 -
 Tests/RunCMake/TargetPolicies/empty.cpp            |    7 ---
 10 files changed, 60 insertions(+), 91 deletions(-)
 delete mode 100644 Tests/RunCMake/TargetPolicies/CMakeLists.txt
 delete mode 100644 Tests/RunCMake/TargetPolicies/PolicyList-result.txt
 delete mode 100644 Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
 delete mode 100644 Tests/RunCMake/TargetPolicies/PolicyList.cmake
 delete mode 100644 Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake
 delete mode 100644 Tests/RunCMake/TargetPolicies/empty.cpp


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list