[Cmake-commits] CMake branch, next, updated. v2.8.11.1-2912-g44442f7

Stephen Kelly steveire at gmail.com
Tue Jul 2 10:17:11 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  44442f707147370160b67b1f6187d547a69e211b (commit)
       via  0e9de78bea00a0b74c4737e17f353c28d471e94a (commit)
       via  be08a09bb334239fbfb645e74ab6bf365abac59b (commit)
       via  b6ec828fa0bf6da02dfc86f7509d624eecb3f0cb (commit)
       via  48c3e48a053dcc5c6eb2203713c7f0e0b2a9d797 (commit)
      from  6489a4fc663d511063c9b1b3c6d8ca30d8df47c3 (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=44442f707147370160b67b1f6187d547a69e211b
commit 44442f707147370160b67b1f6187d547a69e211b
Merge: 6489a4f 0e9de78
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jul 2 10:17:03 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 2 10:17:03 2013 -0400

    Merge topic 'target-policies' into next
    
    0e9de78 Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICY
    be08a09 TLL: Don't populate old link interface if CMP0022 is NEW.
    b6ec828 Export: Generate INTERFACE_LINK_LIBRARIES property on targets.
    48c3e48 Introduce the INTERFACE_LINK_LIBRARIES property.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0e9de78bea00a0b74c4737e17f353c28d471e94a
commit 0e9de78bea00a0b74c4737e17f353c28d471e94a
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri Jun 28 11:25:40 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jul 2 16:16:24 2013 +0200

    Genex: Make CMP0021 and CMP0022 usable with TARGET_POLICY
    
    Use preprocessor loops and add a unit test for the appropriate
    policies. All policies whose value is recorded at target creation
    time should be part of this list.

diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index a02cd88..bc679c0 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -937,10 +937,13 @@ static const struct TargetNameNode : public cmGeneratorExpressionNode
 
 //----------------------------------------------------------------------------
 static const char* targetPolicyWhitelist[] = {
-    "CMP0003"
-  , "CMP0004"
-  , "CMP0008"
-  , "CMP0020"
+  0
+#define TARGET_POLICY_STRING(POLICY) \
+  , #POLICY
+
+  CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_STRING)
+
+#undef TARGET_POLICY_STRING
 };
 
 cmPolicies::PolicyStatus statusForTarget(cmTarget *tgt, const char *policy)
@@ -951,10 +954,7 @@ cmPolicies::PolicyStatus statusForTarget(cmTarget *tgt, const char *policy)
     return tgt->GetPolicyStatus ## POLICY (); \
   } \
 
-  RETURN_POLICY(CMP0003)
-  RETURN_POLICY(CMP0004)
-  RETURN_POLICY(CMP0008)
-  RETURN_POLICY(CMP0020)
+  CM_FOR_EACH_TARGET_POLICY(RETURN_POLICY)
 
 #undef RETURN_POLICY
 
@@ -970,10 +970,7 @@ cmPolicies::PolicyID policyForString(const char *policy_id)
     return cmPolicies:: POLICY_ID; \
   } \
 
-  RETURN_POLICY_ID(CMP0003)
-  RETURN_POLICY_ID(CMP0004)
-  RETURN_POLICY_ID(CMP0008)
-  RETURN_POLICY_ID(CMP0020)
+  CM_FOR_EACH_TARGET_POLICY(RETURN_POLICY_ID)
 
 #undef RETURN_POLICY_ID
 
@@ -1003,7 +1000,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
 
     context->HadContextSensitiveCondition = true;
 
-    for (size_t i = 0;
+    for (size_t i = 1;
          i < (sizeof(targetPolicyWhitelist) /
               sizeof(*targetPolicyWhitelist));
          ++i)
@@ -1029,8 +1026,17 @@ 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 policies CMP0003, CMP0004, "
-      "CMP0008 and CMP0020."
+      "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
       );
     return std::string();
   }
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 442f86f..bfc1c81 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -191,13 +191,14 @@ 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;
@@ -1692,18 +1693,13 @@ void cmTarget::SetMakefile(cmMakefile* mf)
   this->SetPropertyDefault("POSITION_INDEPENDENT_CODE", 0);
 
   // Record current policies for later use.
-  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);
+#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
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index d7ee332..273f4e9 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -19,6 +19,14 @@
 
 #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;
@@ -91,29 +99,13 @@ public:
   void SetMakefile(cmMakefile *mf);
   cmMakefile *GetMakefile() const { return this->Makefile;};
 
-  /** 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; }
+#define DECLARE_TARGET_POLICY(POLICY) \
+  cmPolicies::PolicyStatus GetPolicyStatus ## POLICY () const \
+    { return this->PolicyStatus ## POLICY; }
 
-  /** Get the status of policy CMP0020 when the target was created.  */
-  cmPolicies::PolicyStatus GetPolicyStatusCMP0020() const
-    { return this->PolicyStatusCMP0020; }
+  CM_FOR_EACH_TARGET_POLICY(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; }
+#undef DECLARE_TARGET_POLICY
 
   /**
    * Get the list of the custom commands for this target
@@ -694,12 +686,12 @@ private:
   cmMakefile* Makefile;
 
   // Policy status recorded when target was created.
-  cmPolicies::PolicyStatus PolicyStatusCMP0003;
-  cmPolicies::PolicyStatus PolicyStatusCMP0004;
-  cmPolicies::PolicyStatus PolicyStatusCMP0008;
-  cmPolicies::PolicyStatus PolicyStatusCMP0020;
-  cmPolicies::PolicyStatus PolicyStatusCMP0021;
-  cmPolicies::PolicyStatus PolicyStatusCMP0022;
+#define TARGET_POLICY_MEMBER(POLICY) \
+  cmPolicies::PolicyStatus PolicyStatus ## POLICY;
+
+  CM_FOR_EACH_TARGET_POLICY(TARGET_POLICY_MEMBER)
+
+#undef TARGET_POLICY_MEMBER
 
   // Internal representation details.
   friend class cmTargetInternals;
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index e07c42f..7fd3dba 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -96,6 +96,7 @@ 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
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/CMakeLists.txt
@@ -0,0 +1,3 @@
+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
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
new file mode 100644
index 0000000..6e83b09
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000..c290b65
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/PolicyList.cmake
@@ -0,0 +1,8 @@
+
+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
new file mode 100644
index 0000000..7a94630
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(PolicyList)
diff --git a/Tests/RunCMake/TargetPolicies/empty.cpp b/Tests/RunCMake/TargetPolicies/empty.cpp
new file mode 100644
index 0000000..7279c5e
--- /dev/null
+++ b/Tests/RunCMake/TargetPolicies/empty.cpp
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int empty(void)
+{
+  return 0;
+}

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=be08a09bb334239fbfb645e74ab6bf365abac59b
commit be08a09bb334239fbfb645e74ab6bf365abac59b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jun 4 16:21:33 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jul 2 16:16:24 2013 +0200

    TLL: Don't populate old link interface if CMP0022 is NEW.
    
    Always populate the INTERFACE_LINK_LIBRARIES for interface
    entries. Don't populate the old interface properties
    matching (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?
    if CMP0022 is NEW.

diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 15303c8..70c28d4 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -563,7 +563,11 @@ cmPolicies::cmPolicies()
     "INTERFACE_LINK_LIBRARIES property will be processed and generated for "
     "the IMPORTED target by default.  A new option to the install(EXPORT) "
     "and export commands allows export of the old-style properties for "
-    "compatibility with downstream users of CMake versions older than 2.8.12."
+    "compatibility with downstream users of CMake versions older than "
+    "2.8.12.  "
+    "The target_link_libraries command will no longer populate the "
+    "properties matching LINK_INTERFACE_LIBRARIES(_<CONFIG>)? if this policy "
+    "is NEW."
     "\n"
     "The OLD behavior for this policy is to ignore the "
     "INTERFACE_LINK_LIBRARIES property for in-build targets.  "
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index b7b7691..c5f490e 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -224,12 +224,17 @@ bool cmTargetLinkLibrariesCommand
     cmSystemTools::SetFatalErrorOccured();
     }
 
+  const cmPolicies::PolicyStatus policy22Status
+                      = this->Target->GetPolicyStatusCMP0022();
+
   // If any of the LINK_ options were given, make sure the
   // LINK_INTERFACE_LIBRARIES target property exists.
   // Use of any of the new keywords implies awareness of
   // this property. And if no libraries are named, it should
   // result in an empty link interface.
-  if(this->CurrentProcessingState != ProcessingLinkLibraries &&
+  if((policy22Status == cmPolicies::OLD ||
+      policy22Status == cmPolicies::WARN) &&
+      this->CurrentProcessingState != ProcessingLinkLibraries &&
      !this->Target->GetProperty("LINK_INTERFACE_LIBRARIES"))
     {
     this->Target->SetProperty("LINK_INTERFACE_LIBRARIES", "");
@@ -263,11 +268,30 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
       ->AddLinkLibraryForTarget(this->Target->GetName(), lib, llt);
     if (this->CurrentProcessingState != ProcessingPublicInterface)
       {
+      if (this->Target->GetType() == cmTarget::STATIC_LIBRARY)
+        {
+        this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
+                  ("$<LINK_ONLY:" +
+                  this->Target->GetDebugGeneratorExpressions(lib, llt) +
+                  ">").c_str());
+        }
       // Not LINK_INTERFACE_LIBRARIES or LINK_PUBLIC, do not add to interface.
       return;
       }
     }
 
+  this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
+              this->Target->GetDebugGeneratorExpressions(lib, llt).c_str());
+
+  const cmPolicies::PolicyStatus policy22Status
+                      = this->Target->GetPolicyStatusCMP0022();
+
+  if (policy22Status != cmPolicies::OLD
+      && policy22Status != cmPolicies::WARN)
+    {
+    return;
+    }
+
   // Get the list of configurations considered to be DEBUG.
   std::vector<std::string> const& debugConfigs =
     this->Makefile->GetCMakeInstance()->GetDebugConfigs();
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index c683016..ca651d0 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -92,7 +92,7 @@ public:
       "When this target is linked into another target then the libraries "
       "linked to this target will appear on the link line for the other "
       "target too.  "
-      "See the LINK_INTERFACE_LIBRARIES target property to override the "
+      "See the INTERFACE_LINK_LIBRARIES target property to override the "
       "set of transitive link dependencies for a target.  "
       "Calls to other signatures of this command may set the property "
       "making any libraries linked exclusively by this signature private."
@@ -112,14 +112,19 @@ public:
       "  target_link_libraries(<target> LINK_INTERFACE_LIBRARIES\n"
       "                        [[debug|optimized|general] <lib>] ...)\n"
       "The LINK_INTERFACE_LIBRARIES mode appends the libraries "
-      "to the LINK_INTERFACE_LIBRARIES and its per-configuration equivalent "
-      "target properties instead of using them for linking.  "
-      "Libraries specified as \"debug\" are appended to the "
+      "to the INTERFACE_LINK_LIBRARIES target property instead of using them "
+      "for linking.  If policy CMP0022 is not NEW, then this mode also "
+      "appends libraries to the LINK_INTERFACE_LIBRARIES and its "
+      "per-configuration equivalent.  "
+      "Libraries specified as \"debug\" are wrapped in a generator "
+      "expression to correspond to debug builds.  If policy CMP0022 is not "
+      "NEW, the libraries are also appended to the "
       "LINK_INTERFACE_LIBRARIES_DEBUG property (or to the properties "
       "corresponding to configurations listed in the DEBUG_CONFIGURATIONS "
       "global property if it is set).  "
       "Libraries specified as \"optimized\" are appended to the "
-      "LINK_INTERFACE_LIBRARIES property.  "
+      "INTERFACE_LINK_LIBRARIES property.  If policy CMP0022 is not NEW, "
+      "they are also appended to the LINK_INTERFACE_LIBRARIES property.  "
       "Libraries specified as \"general\" (or without any keyword) are "
       "treated as if specified for both \"debug\" and \"optimized\"."
       "\n"
@@ -131,9 +136,11 @@ public:
       "The LINK_PUBLIC and LINK_PRIVATE modes can be used to specify both "
       "the link dependencies and the link interface in one command.  "
       "Libraries and targets following LINK_PUBLIC are linked to, and are "
-      "made part of the LINK_INTERFACE_LIBRARIES. Libraries and targets "
-      "following LINK_PRIVATE are linked to, but are not made part of the "
-      "LINK_INTERFACE_LIBRARIES.  "
+      "made part of the INTERFACE_LINK_LIBRARIES.  If policy CMP0022 is not "
+      "NEW, they are also made part of the LINK_INTERFACE_LIBRARIES.  "
+      "Libraries and targets following LINK_PRIVATE are linked to, but are "
+      "not made part of the INTERFACE_LINK_LIBRARIES (or "
+      "LINK_INTERFACE_LIBRARIES)."
       "\n"
       "The library dependency graph is normally acyclic (a DAG), but in the "
       "case of mutually-dependent STATIC libraries CMake allows the graph "
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index b003a1b..2240539 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -122,3 +122,5 @@ add_library(libConsumer empty.cpp)
 # evaluates to the empty string in non-Debug cases, ensure that that causes
 # no problems.
 target_link_libraries(libConsumer debug depA)
+
+add_subdirectory(cmp0022)
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
new file mode 100644
index 0000000..dd6ab41
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
@@ -0,0 +1,18 @@
+
+include(GenerateExportHeader)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+cmake_policy(SET CMP0022 NEW)
+add_library(cmp0022lib SHARED cmp0022lib.cpp)
+generate_export_header(cmp0022lib)
+add_library(cmp0022ifacelib SHARED cmp0022ifacelib.cpp)
+generate_export_header(cmp0022ifacelib)
+target_link_libraries(cmp0022lib LINK_PUBLIC cmp0022ifacelib)
+
+assert_property(cmp0022lib LINK_INTERFACE_LIBRARIES "")
+assert_property(cmp0022ifacelib LINK_INTERFACE_LIBRARIES "")
+assert_property(cmp0022lib INTERFACE_LINK_LIBRARIES "cmp0022ifacelib")
+assert_property(cmp0022ifacelib INTERFACE_LINK_LIBRARIES "")
+
+add_executable(cmp0022exe cmp0022exe.cpp)
+target_link_libraries(cmp0022exe cmp0022lib)
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022exe.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022exe.cpp
new file mode 100644
index 0000000..008bb74
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022exe.cpp
@@ -0,0 +1,7 @@
+
+#include "cmp0022lib.h"
+
+int main(void)
+{
+  return cmp0022().Value;
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022ifacelib.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022ifacelib.cpp
new file mode 100644
index 0000000..b285be0
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022ifacelib.cpp
@@ -0,0 +1,9 @@
+
+#include "cmp0022ifacelib.h"
+
+CMP0022Iface cmp0022iface()
+{
+  CMP0022Iface iface;
+  iface.Value = 0;
+  return iface;
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022ifacelib.h b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022ifacelib.h
new file mode 100644
index 0000000..616dbf6
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022ifacelib.h
@@ -0,0 +1,9 @@
+
+#include "cmp0022ifacelib_export.h"
+
+struct CMP0022Iface
+{
+  int Value;
+};
+
+CMP0022Iface CMP0022IFACELIB_EXPORT cmp0022iface();
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.cpp
new file mode 100644
index 0000000..381d463
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.cpp
@@ -0,0 +1,7 @@
+
+#include "cmp0022lib.h"
+
+CMP0022Iface cmp0022()
+{
+  return cmp0022iface();
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.h b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.h
new file mode 100644
index 0000000..3235b9b
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.h
@@ -0,0 +1,6 @@
+
+#include "cmp0022lib_export.h"
+
+#include "cmp0022ifacelib.h"
+
+CMP0022Iface CMP0022LIB_EXPORT cmp0022();
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-result.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt
new file mode 100644
index 0000000..5a5ad27
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt
@@ -0,0 +1,8 @@
+CMake Warning \(dev\) in CMakeLists.txt:
+  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
+  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
+  cmake_policy command to set the policy and suppress this warning.
+
+  Target "bar" has a INTERFACE_LINK_LIBRARIES property which differs from its
+  LINK_INTERFACE_LIBRARIES properties.
+This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake
new file mode 100644
index 0000000..11b4e22
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake
@@ -0,0 +1,11 @@
+
+project(CMP0022-WARN-tll)
+
+add_library(foo SHARED empty_vs6_1.cpp)
+add_library(bar SHARED empty_vs6_2.cpp)
+add_library(bat SHARED empty_vs6_3.cpp)
+target_link_libraries(bar LINK_PUBLIC foo)
+set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat)
+
+add_library(user SHARED empty.cpp)
+target_link_libraries(user bar)
diff --git a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
index 616d664..6b014e3 100644
--- a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
@@ -1,6 +1,7 @@
 include(RunCMake)
 
 run_cmake(CMP0022-WARN)
+run_cmake(CMP0022-WARN-tll)
 run_cmake(CMP0022-WARN-static)
 run_cmake(CMP0022-NOWARN-static)
 run_cmake(CMP0022-export)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b6ec828fa0bf6da02dfc86f7509d624eecb3f0cb
commit b6ec828fa0bf6da02dfc86f7509d624eecb3f0cb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jun 4 16:47:57 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jul 2 16:16:24 2013 +0200

    Export: Generate INTERFACE_LINK_LIBRARIES property on targets.
    
    This property is generated only for targets which have recorded
    policy CMP0022 as NEW, and a compatibility mode is added to
    additionally export the old interfaces in that case too.
    
    If the old interfaces are not exported, the generated export files
    require CMake 2.8.12. Because the unit tests use a version which
    is not yet called 2.8.12, temporarily require a lower version.

diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 326663c..cdc3316 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -77,6 +77,15 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
                                     properties, missingTargets);
     this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
                                   te, properties);
+    const bool newCMP0022Behavior =
+                              te->GetPolicyStatusCMP0022() != cmPolicies::WARN
+                           && te->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+    if (newCMP0022Behavior)
+      {
+      this->PopulateInterfaceLinkLibrariesProperty(te,
+                                    cmGeneratorExpression::BuildInterface,
+                                    properties, missingTargets);
+      }
     this->PopulateCompatibleInterfaceProperties(te, properties);
 
     this->GenerateInterfaceProperties(te, os, properties);
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index ffa8b51..9c3f314 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -30,6 +30,7 @@ cmExportCommand::cmExportCommand()
 ,Append(&Helper, "APPEND", &ArgumentGroup)
 ,Namespace(&Helper, "NAMESPACE", &ArgumentGroup)
 ,Filename(&Helper, "FILE", &ArgumentGroup)
+,ExportOld(&Helper, "EXPORT_LINK_INTERFACE_LIBRARIES", &ArgumentGroup)
 {
   // at first TARGETS
   this->Targets.Follows(0);
@@ -158,6 +159,7 @@ bool cmExportCommand
   ebfg.SetAppendMode(this->Append.IsEnabled());
   ebfg.SetExports(&targets);
   ebfg.SetCommand(this);
+  ebfg.SetExportOld(this->ExportOld.IsEnabled());
 
   // Compute the set of configurations exported.
   std::vector<std::string> configurationTypes;
diff --git a/Source/cmExportCommand.h b/Source/cmExportCommand.h
index ae67b47..87c3452 100644
--- a/Source/cmExportCommand.h
+++ b/Source/cmExportCommand.h
@@ -63,7 +63,7 @@ public:
     {
     return
       "  export(TARGETS [target1 [target2 [...]]] [NAMESPACE <namespace>]\n"
-      "         [APPEND] FILE <filename>)\n"
+      "         [APPEND] FILE <filename> [EXPORT_LINK_INTERFACE_LIBRARIES])\n"
       "Create a file <filename> that may be included by outside projects to "
       "import targets from the current project's build tree.  "
       "This is useful during cross-compiling to build utility executables "
@@ -73,6 +73,10 @@ public:
       "prepended to all target names written to the file.  "
       "If the APPEND option is given the generated code will be appended "
       "to the file instead of overwriting it.  "
+      "The EXPORT_LINK_INTERFACE_LIBRARIES keyword, if present, causes the "
+      "contents of the properties matching "
+      "(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? to be exported, when "
+      "policy CMP0022 is NEW.  "
       "If a library target is included in the export but "
       "a target to which it links is not included the behavior is "
       "unspecified."
@@ -104,6 +108,7 @@ private:
   cmCAEnabler Append;
   cmCAString Namespace;
   cmCAString Filename;
+  cmCAEnabler ExportOld;
 
   friend class cmExportBuildFileGenerator;
   std::string ErrorMessage;
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 6bef017..b4e6e81 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -30,6 +30,7 @@
 cmExportFileGenerator::cmExportFileGenerator()
 {
   this->AppendMode = false;
+  this->ExportOld = false;
 }
 
 //----------------------------------------------------------------------------
@@ -168,6 +169,39 @@ void cmExportFileGenerator::PopulateInterfaceProperty(const char *propName,
     }
 }
 
+void cmExportFileGenerator::GenerateRequiredCMakeVersion(std::ostream& os,
+                                                    const char *versionString)
+{
+  os << "if(CMAKE_VERSION VERSION_LESS " << versionString << ")\n"
+        "  message(FATAL_ERROR \"This file relies on consumers using "
+        "CMake " << versionString << " or greater.\")\n"
+        "endif()\n\n";
+}
+
+//----------------------------------------------------------------------------
+bool cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty(
+                      cmTarget *target,
+                      cmGeneratorExpression::PreprocessContext preprocessRule,
+                      ImportPropertyMap &properties,
+                      std::vector<std::string> &missingTargets)
+{
+  const char *input = target->GetProperty("INTERFACE_LINK_LIBRARIES");
+  if (input)
+    {
+    std::string prepro = cmGeneratorExpression::Preprocess(input,
+                                                           preprocessRule);
+    if (!prepro.empty())
+      {
+      this->ResolveTargetsInGeneratorExpressions(prepro, target,
+                                                 missingTargets,
+                                                 ReplaceFreeTargets);
+      properties["INTERFACE_LINK_LIBRARIES"] = prepro;
+      return true;
+      }
+    }
+  return false;
+}
+
 //----------------------------------------------------------------------------
 static bool isSubDirectory(const char* a, const char* b)
 {
@@ -583,6 +617,22 @@ cmExportFileGenerator
     return;
     }
 
+  const bool newCMP0022Behavior =
+                        target->GetPolicyStatusCMP0022() != cmPolicies::WARN
+                     && target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+
+  if(newCMP0022Behavior && !this->ExportOld)
+    {
+    cmMakefile *mf = target->GetMakefile();
+    cmOStringStream e;
+    e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, "
+         "but also has old-style INTERFACE_LINK_LIBRARIES properties "
+         "populated, but it was exported without the "
+         "EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties";
+    mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+    return;
+    }
+
   if (!*propContent)
     {
     properties["IMPORTED_LINK_INTERFACE_LIBRARIES" + suffix] = "";
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index ed2d93b..a624ba6 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -35,6 +35,8 @@ public:
   /** Set the namespace in which to place exported target names.  */
   void SetNamespace(const char* ns) { this->Namespace = ns; }
 
+  void SetExportOld(bool exportOld) { this->ExportOld = exportOld; }
+
   /** Add a configuration to be exported.  */
   void AddConfiguration(const char* config);
 
@@ -101,6 +103,10 @@ protected:
                                  cmGeneratorExpression::PreprocessContext,
                                  ImportPropertyMap &properties,
                                  std::vector<std::string> &missingTargets);
+  bool PopulateInterfaceLinkLibrariesProperty(cmTarget *target,
+                                 cmGeneratorExpression::PreprocessContext,
+                                 ImportPropertyMap &properties,
+                                 std::vector<std::string> &missingTargets);
   void PopulateInterfaceProperty(const char *propName, cmTarget *target,
                                  ImportPropertyMap &properties);
   void PopulateCompatibleInterfaceProperties(cmTarget *target,
@@ -128,9 +134,14 @@ protected:
                           std::vector<std::string> &missingTargets,
                           FreeTargetsReplace replace = NoReplaceFreeTargets);
 
+  void GenerateRequiredCMakeVersion(std::ostream& os,
+                                    const char *versionString);
+
   // The namespace in which the exports are placed in the generated file.
   std::string Namespace;
 
+  bool ExportOld;
+
   // The set of configurations to export.
   std::vector<std::string> Configurations;
 
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index a966b16..560882e 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -113,6 +113,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
 
   std::vector<std::string> missingTargets;
 
+  bool require2_8_12 = false;
   // Create all the imported targets.
   for(std::vector<cmTarget*>::const_iterator
         tei = allTargets.begin();
@@ -134,6 +135,20 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
                                   te,
                                   cmGeneratorExpression::InstallInterface,
                                   properties, missingTargets);
+
+    const bool newCMP0022Behavior =
+                              te->GetPolicyStatusCMP0022() != cmPolicies::WARN
+                           && te->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+    if (newCMP0022Behavior)
+      {
+      if (this->PopulateInterfaceLinkLibrariesProperty(te,
+                                    cmGeneratorExpression::InstallInterface,
+                                    properties, missingTargets)
+          && !this->ExportOld)
+        {
+        require2_8_12 = true;
+        }
+      }
     this->PopulateInterfaceProperty("INTERFACE_POSITION_INDEPENDENT_CODE",
                                   te, properties);
     this->PopulateCompatibleInterfaceProperties(te, properties);
@@ -141,6 +156,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
     this->GenerateInterfaceProperties(te, os, properties);
     }
 
+  if (require2_8_12)
+    {
+    this->GenerateRequiredCMakeVersion(os, "2.8.11.20130626");
+    }
 
   // Now load per-configuration properties for them.
   os << "# Load information for each installed configuration.\n"
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index dcd418b..d3a8037 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -1196,6 +1196,8 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
   cmInstallCommandArguments ica(this->DefaultComponentName);
   cmCAString exp(&ica.Parser, "EXPORT");
   cmCAString name_space(&ica.Parser, "NAMESPACE", &ica.ArgumentGroup);
+  cmCAEnabler exportOld(&ica.Parser, "EXPORT_LINK_INTERFACE_LIBRARIES",
+                        &ica.ArgumentGroup);
   cmCAString filename(&ica.Parser, "FILE", &ica.ArgumentGroup);
   exp.Follows(0);
 
@@ -1268,15 +1270,40 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
       }
     }
 
+  cmExportSet *exportSet = this->Makefile->GetLocalGenerator()
+                    ->GetGlobalGenerator()->GetExportSets()[exp.GetString()];
+  if (exportOld.IsEnabled())
+    {
+    for(std::vector<cmTargetExport*>::const_iterator
+          tei = exportSet->GetTargetExports()->begin();
+        tei != exportSet->GetTargetExports()->end(); ++tei)
+      {
+      cmTargetExport const* te = *tei;
+      const bool newCMP0022Behavior =
+                      te->Target->GetPolicyStatusCMP0022() != cmPolicies::WARN
+                   && te->Target->GetPolicyStatusCMP0022() != cmPolicies::OLD;
+
+      if(!newCMP0022Behavior)
+        {
+        cmOStringStream e;
+        e << "INSTALL(EXPORT) given keyword \""
+          << "EXPORT_LINK_INTERFACE_LIBRARIES" << "\", but target \""
+          << te->Target->GetName()
+          << "\" does not have policy CMP0022 set to NEW.";
+        this->SetError(e.str().c_str());
+        return false;
+        }
+      }
+    }
+
   // Create the export install generator.
   cmInstallExportGenerator* exportGenerator =
     new cmInstallExportGenerator(
-      this->Makefile->GetLocalGenerator()
-          ->GetGlobalGenerator()->GetExportSets()[exp.GetString()],
+      exportSet,
       ica.GetDestination().c_str(),
       ica.GetPermissions().c_str(), ica.GetConfigurations(),
       ica.GetComponent().c_str(), fname.c_str(),
-      name_space.GetCString(), this->Makefile);
+      name_space.GetCString(), exportOld.IsEnabled(), this->Makefile);
   this->Makefile->AddInstallGenerator(exportGenerator);
 
   return true;
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index 7c06009..39acd23 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -291,6 +291,7 @@ public:
       "          [NAMESPACE <namespace>] [FILE <name>.cmake]\n"
       "          [PERMISSIONS permissions...]\n"
       "          [CONFIGURATIONS [Debug|Release|...]]\n"
+      "          [EXPORT_LINK_INTERFACE_LIBRARIES]\n"
       "          [COMPONENT <component>])\n"
       "The EXPORT form generates and installs a CMake file containing code "
       "to import targets from the installation tree into another project.  "
@@ -306,6 +307,10 @@ public:
       "installed when one of the named configurations is installed.  "
       "Additionally, the generated import file will reference only the "
       "matching target configurations.  "
+      "The EXPORT_LINK_INTERFACE_LIBRARIES keyword, if present, causes the "
+      "contents of the properties matching "
+      "(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)? to be exported, when "
+      "policy CMP0022 is NEW.  "
       "If a COMPONENT option is specified that does not match that given "
       "to the targets associated with <export-name> the behavior is "
       "undefined.  "
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index 0a645a8..3e9e6ac 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -33,12 +33,14 @@ cmInstallExportGenerator::cmInstallExportGenerator(
   std::vector<std::string> const& configurations,
   const char* component,
   const char* filename, const char* name_space,
+  bool exportOld,
   cmMakefile* mf)
   :cmInstallGenerator(destination, configurations, component)
   ,ExportSet(exportSet)
   ,FilePermissions(file_permissions)
   ,FileName(filename)
   ,Namespace(name_space)
+  ,ExportOld(exportOld)
   ,Makefile(mf)
 {
   this->EFGen = new cmExportInstallFileGenerator(this);
@@ -137,6 +139,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
   // Generate the import file for this export set.
   this->EFGen->SetExportFile(this->MainImportFile.c_str());
   this->EFGen->SetNamespace(this->Namespace.c_str());
+  this->EFGen->SetExportOld(this->ExportOld);
   if(this->ConfigurationTypes->empty())
     {
     if(this->ConfigurationName && *this->ConfigurationName)
diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h
index 7aff731..37b5593 100644
--- a/Source/cmInstallExportGenerator.h
+++ b/Source/cmInstallExportGenerator.h
@@ -31,7 +31,7 @@ public:
                            const std::vector<std::string>& configurations,
                            const char* component,
                            const char* filename, const char* name_space,
-                           cmMakefile* mf);
+                           bool exportOld, cmMakefile* mf);
   ~cmInstallExportGenerator();
 
   cmExportSet* GetExportSet() {return this->ExportSet;}
@@ -52,6 +52,7 @@ protected:
   std::string FilePermissions;
   std::string FileName;
   std::string Namespace;
+  bool ExportOld;
   cmMakefile* Makefile;
 
   std::string TempDir;
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 20c3058..15303c8 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -559,6 +559,11 @@ cmPolicies::cmPolicies()
     "and INTERFACE_COMPILE_OPTIONS properties.  For in-build targets, CMake "
     "will use the INTERFACE_LINK_LIBRARIES property as the source of the "
     "link interface only if policy CMP0022 is NEW.  "
+    "When exporting a target which has this policy set to NEW, only the "
+    "INTERFACE_LINK_LIBRARIES property will be processed and generated for "
+    "the IMPORTED target by default.  A new option to the install(EXPORT) "
+    "and export commands allows export of the old-style properties for "
+    "compatibility with downstream users of CMake versions older than 2.8.12."
     "\n"
     "The OLD behavior for this policy is to ignore the "
     "INTERFACE_LINK_LIBRARIES property for in-build targets.  "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 54057e9..442f86f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -5936,11 +5936,16 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
 
   // Get the link interface.
   {
-  std::string linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
-  linkProp += suffix;
-
+  std::string linkProp = "INTERFACE_LINK_LIBRARIES";
   const char *propertyLibs = this->GetProperty(linkProp.c_str());
 
+  if (!propertyLibs)
+    {
+    linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
+    linkProp += suffix;
+    propertyLibs = this->GetProperty(linkProp.c_str());
+    }
+
   if(!propertyLibs)
     {
     linkProp = "IMPORTED_LINK_INTERFACE_LIBRARIES";
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index efecd03..da15d62 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -232,6 +232,33 @@ target_link_libraries(testSharedLibDepends LINK_PUBLIC renamed_on_export)
 target_link_libraries(testSharedLibDepends LINK_INTERFACE_LIBRARIES
   $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:$<TARGET_NAME:testSharedLibRequired>>)
 
+add_library(cmp0022OLD SHARED cmp0022_vs6_1.cpp)
+generate_export_header(cmp0022OLD BASE_NAME cmp0022)
+target_include_directories(cmp0022OLD PUBLIC
+  "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
+  "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/cmp0022>"
+)
+cmake_policy(SET CMP0022 NEW)
+add_library(cmp0022NEW SHARED cmp0022_vs6_1.cpp)
+target_include_directories(cmp0022NEW PUBLIC
+  "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
+  "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/cmp0022>"
+)
+cmake_policy(SET CMP0022 OLD)
+install(FILES
+  "${CMAKE_CURRENT_SOURCE_DIR}/cmp0022.h"
+  "${CMAKE_CURRENT_BINARY_DIR}/cmp0022_export.h"
+    DESTINATION include/cmp0022
+)
+
+set_property(TARGET testLib2 APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USING_TESTLIB2)
+set_property(TARGET testLib3 APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS USING_TESTLIB3)
+
+set_property(TARGET cmp0022NEW APPEND PROPERTY INTERFACE_LINK_LIBRARIES testLib2)
+# set_property(TARGET cmp0022NEW APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLibIncludeRequired2) # TODO: Test for error
+set_property(TARGET cmp0022OLD APPEND PROPERTY INTERFACE_LINK_LIBRARIES testLib2)
+set_property(TARGET cmp0022OLD APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLib3)
+
 install(TARGETS testLibRequired
                 testLibIncludeRequired1
                 testLibIncludeRequired2
@@ -273,6 +300,7 @@ install(
   testExe2lib testLib4lib testLib4libdbg testLib4libopt
   testLib6
   testLibCycleA testLibCycleB
+  cmp0022NEW cmp0022OLD
   EXPORT exp
   RUNTIME DESTINATION bin
   LIBRARY DESTINATION lib NAMELINK_SKIP
@@ -316,6 +344,7 @@ add_subdirectory(sublib) # For CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE test.
 export(TARGETS testExe1 testLib1 testLib2 testLib3
   testExe2libImp testLib3Imp testLib3ImpDep subdirlib
   testSharedLibRequired testSharedLibDepends renamed_on_export
+  cmp0022NEW cmp0022OLD
   NAMESPACE bld_
   FILE ExportBuildTree.cmake
   )
diff --git a/Tests/ExportImport/Export/cmp0022.cpp b/Tests/ExportImport/Export/cmp0022.cpp
new file mode 100644
index 0000000..bef8e61
--- /dev/null
+++ b/Tests/ExportImport/Export/cmp0022.cpp
@@ -0,0 +1,7 @@
+
+#include "cmp0022.h"
+
+int cmp0022()
+{
+  return 0;
+}
diff --git a/Tests/ExportImport/Export/cmp0022.h b/Tests/ExportImport/Export/cmp0022.h
new file mode 100644
index 0000000..32bf71a
--- /dev/null
+++ b/Tests/ExportImport/Export/cmp0022.h
@@ -0,0 +1,4 @@
+
+#include "cmp0022_export.h"
+
+int CMP0022_EXPORT cmp0022();
diff --git a/Tests/ExportImport/Export/cmp0022_vs6_1.cpp b/Tests/ExportImport/Export/cmp0022_vs6_1.cpp
new file mode 100644
index 0000000..a6ec838
--- /dev/null
+++ b/Tests/ExportImport/Export/cmp0022_vs6_1.cpp
@@ -0,0 +1 @@
+#include "cmp0022.cpp"
diff --git a/Tests/ExportImport/Export/cmp0022_vs6_2.cpp b/Tests/ExportImport/Export/cmp0022_vs6_2.cpp
new file mode 100644
index 0000000..a6ec838
--- /dev/null
+++ b/Tests/ExportImport/Export/cmp0022_vs6_2.cpp
@@ -0,0 +1 @@
+#include "cmp0022.cpp"
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 3bfbc46..376abac 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -68,6 +68,16 @@ target_link_libraries(imp_testExe1b
   bld_testLibCycleA
   )
 
+add_executable(cmp0022OLD_test cmp0022OLD_test_vs6_1.cpp)
+target_link_libraries(cmp0022OLD_test bld_cmp0022OLD)
+add_executable(cmp0022NEW_test cmp0022NEW_test_vs6_1.cpp)
+target_link_libraries(cmp0022NEW_test bld_cmp0022NEW)
+
+add_executable(cmp0022OLD_exp_test cmp0022OLD_test_vs6_2.cpp)
+target_link_libraries(cmp0022OLD_exp_test exp_cmp0022OLD)
+add_executable(cmp0022NEW_exp_test cmp0022NEW_test_vs6_2.cpp)
+target_link_libraries(cmp0022NEW_exp_test exp_cmp0022NEW)
+
 # Try building a plugin to an executable imported from the build tree.
 add_library(imp_mod1b MODULE imp_mod1.c)
 target_link_libraries(imp_mod1b bld_testExe2)
diff --git a/Tests/ExportImport/Import/A/cmp0022NEW_test.cpp b/Tests/ExportImport/Import/A/cmp0022NEW_test.cpp
new file mode 100644
index 0000000..5878349
--- /dev/null
+++ b/Tests/ExportImport/Import/A/cmp0022NEW_test.cpp
@@ -0,0 +1,12 @@
+
+#ifndef USING_TESTLIB2
+#error Expected USING_TESTLIB2
+#endif
+#ifdef USING_TESTLIB3
+#error Unexpected USING_TESTLIB3
+#endif
+
+int main(void)
+{
+  return 0;
+}
diff --git a/Tests/ExportImport/Import/A/cmp0022NEW_test_vs6_1.cpp b/Tests/ExportImport/Import/A/cmp0022NEW_test_vs6_1.cpp
new file mode 100644
index 0000000..033b746
--- /dev/null
+++ b/Tests/ExportImport/Import/A/cmp0022NEW_test_vs6_1.cpp
@@ -0,0 +1 @@
+#include "cmp0022NEW_test.cpp"
diff --git a/Tests/ExportImport/Import/A/cmp0022NEW_test_vs6_2.cpp b/Tests/ExportImport/Import/A/cmp0022NEW_test_vs6_2.cpp
new file mode 100644
index 0000000..033b746
--- /dev/null
+++ b/Tests/ExportImport/Import/A/cmp0022NEW_test_vs6_2.cpp
@@ -0,0 +1 @@
+#include "cmp0022NEW_test.cpp"
diff --git a/Tests/ExportImport/Import/A/cmp0022OLD_test.cpp b/Tests/ExportImport/Import/A/cmp0022OLD_test.cpp
new file mode 100644
index 0000000..e50158b
--- /dev/null
+++ b/Tests/ExportImport/Import/A/cmp0022OLD_test.cpp
@@ -0,0 +1,12 @@
+
+#ifdef USING_TESTLIB2
+#error Unexpected USING_TESTLIB2
+#endif
+#ifndef USING_TESTLIB3
+#error Expected USING_TESTLIB3
+#endif
+
+int main(void)
+{
+  return 0;
+}
diff --git a/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_1.cpp b/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_1.cpp
new file mode 100644
index 0000000..90d804c
--- /dev/null
+++ b/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_1.cpp
@@ -0,0 +1 @@
+#include "cmp0022OLD_test.cpp"
diff --git a/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_2.cpp b/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_2.cpp
new file mode 100644
index 0000000..90d804c
--- /dev/null
+++ b/Tests/ExportImport/Import/A/cmp0022OLD_test_vs6_2.cpp
@@ -0,0 +1 @@
+#include "cmp0022OLD_test.cpp"
diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-result.txt b/Tests/RunCMake/CMP0022/CMP0022-export-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-export-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt
new file mode 100644
index 0000000..6c29057
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at CMP0022-export.cmake:11 \(export\):
+  Target "cmp0022NEW" has policy CMP0022 enabled, but also has old-style
+  INTERFACE_LINK_LIBRARIES properties populated, but it was exported without
+  the EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties
diff --git a/Tests/RunCMake/CMP0022/CMP0022-export.cmake b/Tests/RunCMake/CMP0022/CMP0022-export.cmake
new file mode 100644
index 0000000..06147f3
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-export.cmake
@@ -0,0 +1,11 @@
+
+project(cmp0022NEW)
+
+cmake_policy(SET CMP0022 NEW)
+
+add_library(cmp0022NEW SHARED empty_vs6_1.cpp)
+add_library(testLib SHARED empty_vs6_2.cpp)
+
+set_property(TARGET cmp0022NEW APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLib)
+
+export(TARGETS cmp0022NEW testLib FILE "${CMAKE_CURRENT_BINARY_DIR}/cmp0022NEW.cmake")
diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt b/Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt
new file mode 100644
index 0000000..3425e8e
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error in CMakeLists.txt:
+  Target "cmp0022NEW" has policy CMP0022 enabled, but also has old-style
+  INTERFACE_LINK_LIBRARIES properties populated, but it was exported without
+  the EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties
diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake b/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake
new file mode 100644
index 0000000..171febe
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake
@@ -0,0 +1,12 @@
+
+project(cmp0022NEW)
+
+cmake_policy(SET CMP0022 NEW)
+
+add_library(cmp0022NEW SHARED empty_vs6_1.cpp)
+add_library(testLib SHARED empty_vs6_2.cpp)
+
+set_property(TARGET cmp0022NEW APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLib)
+
+install(TARGETS cmp0022NEW testLib EXPORT exp DESTINATION lib)
+install(EXPORT exp FILE expTargets.cmake DESTINATION lib/cmake/exp)
diff --git a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
index 2e74f17..616d664 100644
--- a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
@@ -3,3 +3,5 @@ include(RunCMake)
 run_cmake(CMP0022-WARN)
 run_cmake(CMP0022-WARN-static)
 run_cmake(CMP0022-NOWARN-static)
+run_cmake(CMP0022-export)
+run_cmake(CMP0022-install-export)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48c3e48a053dcc5c6eb2203713c7f0e0b2a9d797
commit 48c3e48a053dcc5c6eb2203713c7f0e0b2a9d797
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jun 4 16:25:47 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jul 2 16:16:23 2013 +0200

    Introduce the INTERFACE_LINK_LIBRARIES property.
    
    This property replaces the properties which
    match (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?, and is enabled
    for IMPORTED targets, and for non-IMPORTED targets only with a policy.
    
    For static libraries, the INTERFACE_LINK_LIBRARIES property is
    also used as the source of transitive usage requirements content.
    Static libraries still require users to link to all entries in
    their LINK_LIBRARIES, but usage requirements such as INCLUDE_DIRECTORIES
    COMPILE_DEFINITIONS and COMPILE_OPTIONS can be restricted to only
    certain interface libraries.
    
    Because the INTERFACE_LINK_LIBRARIES property is populated unconditionally,
    we need to compare the evaluated result of it with the link implementation
    to determine whether to issue the policy warning for static libraries. For
    shared libraries, the policy warning is issued if the contents of
    the INTERFACE_LINK_LIBRARIES property differs from the contents of the
    relevant config-specific old LINK_INTERFACE_LIBRARIES property.

diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index a4d5453..8b17c37 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -174,7 +174,8 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(const char *tgt)
        || strcmp(prop, "LINK_INTERFACE_LIBRARIES") == 0
        || strcmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES") == 0
        || strncmp(prop, "LINK_INTERFACE_LIBRARIES_", 25) == 0
-       || strncmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES_", 34) == 0);
+       || strncmp(prop, "IMPORTED_LINK_INTERFACE_LIBRARIES_", 34) == 0)
+       || strcmp(prop, "INTERFACE_LINK_LIBRARIES") == 0;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 32829a6..20c3058 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -544,6 +544,28 @@ cmPolicies::cmPolicies()
     "The NEW behavior for this policy is to issue a FATAL_ERROR if "
     "INCLUDE_DIRECTORIES contains a relative path.",
     2,8,11,20130516, cmPolicies::WARN);
+
+  this->DefinePolicy(
+    CMP0022, "CMP0022",
+    "INTERFACE_LINK_LIBRARIES defines the link interface.",
+    "CMake 2.8.11 constructed the 'link interface' of a target from "
+    "properties matching (IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?.  "
+    "The modern way to specify config-sensitive content is to use generator "
+    "expressions and the IMPORTED_ prefix makes uniform processing of the "
+    "link interface with generator expressions impossible.  The "
+    "INTERFACE_LINK_LIBRARIES target property was introduced as a "
+    "replacement in CMake 2.8.12. This new property is named consistently "
+    "with the INTERFACE_COMPILE_DEFINITIONS, INTERFACE_INCLUDE_DIRECTORIES "
+    "and INTERFACE_COMPILE_OPTIONS properties.  For in-build targets, CMake "
+    "will use the INTERFACE_LINK_LIBRARIES property as the source of the "
+    "link interface only if policy CMP0022 is NEW.  "
+    "\n"
+    "The OLD behavior for this policy is to ignore the "
+    "INTERFACE_LINK_LIBRARIES property for in-build targets.  "
+    "The NEW behavior for this policy is to use the INTERFACE_LINK_LIBRARIES "
+    "property for in-build targets, and ignore the old properties matching "
+    "(IMPORTED_)?LINK_INTERFACE_LIBRARIES(_<CONFIG>)?.",
+    2,8,11,20130516, cmPolicies::WARN);
 }
 
 cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index a033e87..20c953f 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -72,6 +72,7 @@ public:
     CMP0020, ///< Automatically link Qt executables to qtmain target
     CMP0021, ///< Fatal error on relative paths in INCLUDE_DIRECTORIES
     /// target property
+    CMP0022, ///< INTERFACE_LINK_LIBRARIES defines the link interface
 
     /** \brief Always the last entry.
      *
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ae442bb..54057e9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -197,6 +197,7 @@ cmTarget::cmTarget()
   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;
@@ -472,7 +473,7 @@ void cmTarget::DefineProperties(cmake *cm)
      "imported library.  "
      "The list "
      "should be disjoint from the list of interface libraries in the "
-     "IMPORTED_LINK_INTERFACE_LIBRARIES property.  On platforms requiring "
+     "INTERFACE_LINK_LIBRARIES property.  On platforms requiring "
      "dependent shared libraries to be found at link time CMake uses this "
      "list to add appropriate files or paths to the link command line.  "
      "Ignored for non-imported targets.");
@@ -493,7 +494,10 @@ void cmTarget::DefineProperties(cmake *cm)
      "The libraries will be included on the link line for the target.  "
      "Unlike the LINK_INTERFACE_LIBRARIES property, this property applies "
      "to all imported target types, including STATIC libraries.  "
-     "This property is ignored for non-imported targets.");
+     "This property is ignored for non-imported targets.\n"
+     "This property is ignored if the target also has a non-empty "
+     "INTERFACE_LINK_LIBRARIES property.\n"
+     "This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.");
 
   cm->DefineProperty
     ("IMPORTED_LINK_INTERFACE_LIBRARIES_<CONFIG>", cmProperty::TARGET,
@@ -501,7 +505,10 @@ void cmTarget::DefineProperties(cmake *cm)
      "Configuration names correspond to those provided by the project "
      "from which the target is imported.  "
      "If set, this property completely overrides the generic property "
-     "for the named configuration.");
+     "for the named configuration.\n"
+     "This property is ignored if the target also has a non-empty "
+     "INTERFACE_LINK_LIBRARIES property.\n"
+     "This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.");
 
   cm->DefineProperty
     ("IMPORTED_LINK_INTERFACE_LANGUAGES", cmProperty::TARGET,
@@ -818,7 +825,10 @@ void cmTarget::DefineProperties(cmake *cm)
      "This property is initialized by the value of the variable "
      "CMAKE_LINK_INTERFACE_LIBRARIES if it is set when a target is "
      "created.  "
-     "This property is ignored for STATIC libraries.");
+     "This property is ignored for STATIC libraries.\n"
+     "This property is overriden by the INTERFACE_LINK_LIBRARIES property if "
+     "policy CMP0022 is NEW.\n"
+     "This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.");
 
   cm->DefineProperty
     ("LINK_INTERFACE_LIBRARIES_<CONFIG>", cmProperty::TARGET,
@@ -826,7 +836,23 @@ void cmTarget::DefineProperties(cmake *cm)
      "This is the configuration-specific version of "
      "LINK_INTERFACE_LIBRARIES.  "
      "If set, this property completely overrides the generic property "
-     "for the named configuration.");
+     "for the named configuration.\n"
+     "This property is overriden by the INTERFACE_LINK_LIBRARIES property if "
+     "policy CMP0022 is NEW.\n"
+     "This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead.");
+
+  cm->DefineProperty
+    ("INTERFACE_LINK_LIBRARIES", cmProperty::TARGET,
+     "List public interface libraries for a shared library or executable.",
+     "This property contains the list of transitive link dependencies.  "
+     "When the target is linked into another target the libraries "
+     "listed (and recursively their link interface libraries) will be "
+     "provided to the other target also.  "
+     "This property is overriden by the LINK_INTERFACE_LIBRARIES or "
+     "LINK_INTERFACE_LIBRARIES_<CONFIG> property if "
+     "policy CMP0022 is OLD or unset.\n"
+     "\n"
+     CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
 
   cm->DefineProperty
     ("INTERFACE_INCLUDE_DIRECTORIES", cmProperty::TARGET,
@@ -1676,6 +1702,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     this->Makefile->GetPolicyStatus(cmPolicies::CMP0020);
   this->PolicyStatusCMP0021 =
     this->Makefile->GetPolicyStatus(cmPolicies::CMP0021);
+  this->PolicyStatusCMP0022 =
+    this->Makefile->GetPolicyStatus(cmPolicies::CMP0022);
 }
 
 //----------------------------------------------------------------------------
@@ -3526,6 +3554,29 @@ static void cmTargetCheckLINK_INTERFACE_LIBRARIES(
 }
 
 //----------------------------------------------------------------------------
+static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value,
+                                                  cmMakefile* context)
+{
+  // Look for link-type keywords in the value.
+  static cmsys::RegularExpression
+    keys("(^|;)(debug|optimized|general)(;|$)");
+  if(!keys.find(value))
+    {
+    return;
+    }
+
+  // Report an error.
+  cmOStringStream e;
+
+  e << "Property INTERFACE_LINK_LIBRARIES may not contain link-type "
+    "keyword \"" << keys.match(2) << "\".  The INTERFACE_LINK_LIBRARIES "
+    "property may contain configuration-sensitive generator-expressions "
+    "which may be used to specify per-configuration rules.";
+
+  context->IssueMessage(cmake::FATAL_ERROR, e.str());
+}
+
+//----------------------------------------------------------------------------
 void cmTarget::CheckProperty(const char* prop, cmMakefile* context)
 {
   // Certain properties need checking.
@@ -3543,6 +3594,13 @@ void cmTarget::CheckProperty(const char* prop, cmMakefile* context)
       cmTargetCheckLINK_INTERFACE_LIBRARIES(prop, value, context, true);
       }
     }
+  if(strncmp(prop, "INTERFACE_LINK_LIBRARIES", 24) == 0)
+    {
+    if(const char* value = this->GetProperty(prop))
+      {
+      cmTargetCheckINTERFACE_LINK_LIBRARIES(value, context);
+      }
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -6011,8 +6069,34 @@ void cmTarget::GetTransitivePropertyLinkLibraries(
     {
     return;
     }
+  if(this->GetType() != STATIC_LIBRARY
+      || this->GetPolicyStatusCMP0022() == cmPolicies::WARN
+      || this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
+    {
+    libs = iface->Libraries;
+    return;
+    }
+
+  const char* linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
+  const char* interfaceLibs = this->GetProperty(linkIfaceProp);
 
-  libs = iface->Libraries;
+  if (!interfaceLibs)
+    {
+    return;
+    }
+
+  // The interface libraries have been explicitly set.
+  cmListFileBacktrace lfbt;
+  cmGeneratorExpression ge(lfbt);
+  cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
+                                              linkIfaceProp, 0, 0);
+  dagChecker.SetTransitivePropertiesOnly();
+  cmSystemTools::ExpandListArgument(ge.Parse(interfaceLibs)->Evaluate(
+                                      this->Makefile,
+                                      config,
+                                      false,
+                                      headTarget,
+                                      this, &dagChecker), libs);
 }
 
 //----------------------------------------------------------------------------
@@ -6033,6 +6117,8 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
   // An explicit list of interface libraries may be set for shared
   // libraries and executables that export symbols.
   const char* explicitLibraries = 0;
+  const char* newExplicitLibraries =
+                                this->GetProperty("INTERFACE_LINK_LIBRARIES");
   std::string linkIfaceProp;
   if(this->GetType() == cmTarget::SHARED_LIBRARY ||
      this->IsExecutableWithExports())
@@ -6048,6 +6134,81 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
       linkIfaceProp = "LINK_INTERFACE_LIBRARIES";
       explicitLibraries = this->GetProperty(linkIfaceProp.c_str());
       }
+    if (newExplicitLibraries
+        && (!explicitLibraries ||
+            (explicitLibraries
+              && strcmp(newExplicitLibraries, explicitLibraries) != 0)))
+      {
+      switch(this->GetPolicyStatusCMP0022())
+        {
+        case cmPolicies::WARN:
+          {
+          cmOStringStream w;
+          w << (this->Makefile->GetPolicies()
+                ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
+            << "Target \"" << this->GetName() << "\" has a "
+              "INTERFACE_LINK_LIBRARIES property which differs from its "
+            << linkIfaceProp << " properties.";
+          this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+          }
+          // Fall through
+        case cmPolicies::OLD:
+          break;
+        case cmPolicies::REQUIRED_IF_USED:
+        case cmPolicies::REQUIRED_ALWAYS:
+        case cmPolicies::NEW:
+          explicitLibraries = newExplicitLibraries;
+          linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
+          break;
+        }
+      }
+    }
+  else if(this->GetType() == cmTarget::STATIC_LIBRARY)
+    {
+    if (newExplicitLibraries)
+      {
+      cmListFileBacktrace lfbt;
+      cmGeneratorExpression ge(lfbt);
+      cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
+                                            "INTERFACE_LINK_LIBRARIES", 0, 0);
+      std::vector<std::string> ifaceLibs;
+      cmSystemTools::ExpandListArgument(
+          ge.Parse(newExplicitLibraries)->Evaluate(
+                                          this->Makefile,
+                                          config,
+                                          false,
+                                          headTarget,
+                                          this, &dagChecker), ifaceLibs);
+      LinkImplementation const* impl = this->GetLinkImplementation(config,
+                                                                headTarget);
+      if (ifaceLibs != impl->Libraries)
+        {
+        switch(this->GetPolicyStatusCMP0022())
+          {
+          case cmPolicies::WARN:
+            {
+            cmOStringStream w;
+            w << (this->Makefile->GetPolicies()
+                  ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
+              << "Static library target \"" << this->GetName() << "\" has a "
+                "INTERFACE_LINK_LIBRARIES property.  This should be preferred "
+                "as the source of the link interface for this library.  "
+                "Ignoring the property and using the link implementation "
+                "as the link interface instead.";
+            this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+            }
+            // Fall through
+          case cmPolicies::OLD:
+            break;
+          case cmPolicies::REQUIRED_IF_USED:
+          case cmPolicies::REQUIRED_ALWAYS:
+          case cmPolicies::NEW:
+            explicitLibraries = newExplicitLibraries;
+            linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
+            break;
+          }
+        }
+      }
     }
 
   // There is no implicit link interface for executables or modules
@@ -6111,7 +6272,11 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
         }
       }
     }
-  else
+  else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN
+        || this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
+    // The implementation shouldn't be the interface if CMP0022 is NEW. That
+    // way, the LINK_LIBRARIES property can be set directly without having to
+    // empty the INTERFACE_LINK_LIBRARIES
     {
     // The link implementation is the default link interface.
     LinkImplementation const* impl = this->GetLinkImplementation(config,
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index dd28405..d7ee332 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -111,6 +111,10 @@ public:
   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
    */
@@ -695,6 +699,7 @@ private:
   cmPolicies::PolicyStatus PolicyStatusCMP0008;
   cmPolicies::PolicyStatus PolicyStatusCMP0020;
   cmPolicies::PolicyStatus PolicyStatusCMP0021;
+  cmPolicies::PolicyStatus PolicyStatusCMP0022;
 
   // Internal representation details.
   friend class cmTargetInternals;
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index b660442..abd2d8d 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2523,6 +2523,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --test-command IncludeDirectories)
   list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories")
 
+  add_test(InterfaceLinkLibraries ${CMAKE_CTEST_COMMAND}
+    --build-and-test
+    "${CMake_SOURCE_DIR}/Tests/InterfaceLinkLibraries"
+    "${CMake_BINARY_DIR}/Tests/InterfaceLinkLibraries"
+    --build-two-config
+    ${build_generator_args}
+    --build-project InterfaceLinkLibraries
+    --test-command InterfaceLinkLibraries)
+  list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InterfaceLinkLibraries")
+
   if(CMAKE_USE_KWSTYLE AND KWSTYLE_EXECUTABLE)
     # The "make StyleCheck" command line as a test. If the test fails, look
     # for lines like "Error #0 (624) Line length exceed 88 (max=79)" in the
diff --git a/Tests/InterfaceLinkLibraries/CMakeLists.txt b/Tests/InterfaceLinkLibraries/CMakeLists.txt
new file mode 100644
index 0000000..bd0cf74
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/CMakeLists.txt
@@ -0,0 +1,49 @@
+cmake_minimum_required (VERSION 2.8)
+
+cmake_policy(SET CMP0022 NEW)
+
+project(InterfaceLinkLibraries)
+
+add_library(foo_shared SHARED foo_vs6_1.cpp)
+target_compile_definitions(foo_shared INTERFACE FOO_LIBRARY)
+add_library(bar_shared SHARED bar_vs6_1.cpp)
+target_compile_definitions(bar_shared INTERFACE BAR_LIBRARY)
+set_property(TARGET bar_shared APPEND PROPERTY INTERFACE_LINK_LIBRARIES foo_shared)
+
+add_executable(shared_test main_vs6_1.cpp)
+set_property(TARGET shared_test APPEND PROPERTY LINK_LIBRARIES bar_shared)
+
+add_library(foo_static STATIC foo_vs6_2.cpp)
+target_compile_definitions(foo_static INTERFACE FOO_LIBRARY)
+add_library(bar_static STATIC bar_vs6_2.cpp)
+target_compile_definitions(bar_static INTERFACE BAR_LIBRARY)
+set_property(TARGET bar_static APPEND PROPERTY INTERFACE_LINK_LIBRARIES foo_static)
+
+add_executable(static_test main_vs6_2.cpp)
+set_property(TARGET static_test APPEND PROPERTY LINK_LIBRARIES bar_static)
+
+add_library(foo_shared_private SHARED foo_vs6_3.cpp)
+target_compile_definitions(foo_shared_private INTERFACE FOO_LIBRARY)
+add_library(bang_shared_private SHARED bang_vs6_1.cpp)
+target_compile_definitions(bang_shared_private INTERFACE BANG_LIBRARY)
+add_library(bar_shared_private SHARED bar_vs6_3.cpp)
+target_compile_definitions(bar_shared_private INTERFACE BAR_LIBRARY)
+target_compile_definitions(bar_shared_private PRIVATE BAR_USE_BANG)
+set_property(TARGET bar_shared_private APPEND PROPERTY LINK_LIBRARIES bang_shared_private)
+set_property(TARGET bar_shared_private APPEND PROPERTY INTERFACE_LINK_LIBRARIES foo_shared_private)
+
+add_executable(shared_private_test main_vs6_3.cpp)
+set_property(TARGET shared_private_test APPEND PROPERTY LINK_LIBRARIES bar_shared_private)
+
+add_library(foo_static_private STATIC foo_vs6_4.cpp)
+target_compile_definitions(foo_static_private INTERFACE FOO_LIBRARY)
+add_library(bang_static_private STATIC bang_vs6_2.cpp)
+target_compile_definitions(bang_static_private INTERFACE BANG_LIBRARY)
+add_library(bar_static_private STATIC bar_vs6_4.cpp)
+target_compile_definitions(bar_static_private INTERFACE BAR_LIBRARY)
+target_compile_definitions(bar_static_private PRIVATE BAR_USE_BANG)
+set_property(TARGET bar_static_private APPEND PROPERTY LINK_LIBRARIES bang_static_private)
+set_property(TARGET bar_static_private APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<LINK_ONLY:bang_static_private> foo_static_private)
+
+add_executable(InterfaceLinkLibraries main_vs6_4.cpp)
+set_property(TARGET InterfaceLinkLibraries APPEND PROPERTY LINK_LIBRARIES bar_static_private)
diff --git a/Tests/InterfaceLinkLibraries/bang.cpp b/Tests/InterfaceLinkLibraries/bang.cpp
new file mode 100644
index 0000000..2e95098
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bang.cpp
@@ -0,0 +1,15 @@
+
+#ifdef FOO_LIBRARY
+#error Unexpected FOO_LIBRARY
+#endif
+
+#ifdef BAR_LIBRARY
+#error Unexpected BAR_LIBRARY
+#endif
+
+#include "bang.h"
+
+int bang()
+{
+  return 0;
+}
diff --git a/Tests/InterfaceLinkLibraries/bang.h b/Tests/InterfaceLinkLibraries/bang.h
new file mode 100644
index 0000000..acffb39
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bang.h
@@ -0,0 +1,4 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int bang();
diff --git a/Tests/InterfaceLinkLibraries/bang_vs6_1.cpp b/Tests/InterfaceLinkLibraries/bang_vs6_1.cpp
new file mode 100644
index 0000000..4886861
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bang_vs6_1.cpp
@@ -0,0 +1 @@
+#include "bang.cpp"
diff --git a/Tests/InterfaceLinkLibraries/bang_vs6_2.cpp b/Tests/InterfaceLinkLibraries/bang_vs6_2.cpp
new file mode 100644
index 0000000..4886861
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bang_vs6_2.cpp
@@ -0,0 +1 @@
+#include "bang.cpp"
diff --git a/Tests/InterfaceLinkLibraries/bar.cpp b/Tests/InterfaceLinkLibraries/bar.cpp
new file mode 100644
index 0000000..f39bfa5
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bar.cpp
@@ -0,0 +1,26 @@
+
+#ifdef FOO_LIBRARY
+#error Unexpected FOO_LIBRARY
+#endif
+
+#ifdef BAR_USE_BANG
+#  ifndef BANG_LIBRARY
+#    error Expected BANG_LIBRARY
+#  endif
+#  include "bang.h"
+#else
+#  ifdef BANG_LIBRARY
+#    error Unexpected BANG_LIBRARY
+#  endif
+#endif
+
+#include "bar.h"
+
+int bar()
+{
+#ifdef BAR_USE_BANG
+  return bang();
+#else
+  return 0;
+#endif
+}
diff --git a/Tests/InterfaceLinkLibraries/bar.h b/Tests/InterfaceLinkLibraries/bar.h
new file mode 100644
index 0000000..f83b37e
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bar.h
@@ -0,0 +1,7 @@
+
+#include "foo.h"
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int bar();
diff --git a/Tests/InterfaceLinkLibraries/bar_vs6_1.cpp b/Tests/InterfaceLinkLibraries/bar_vs6_1.cpp
new file mode 100644
index 0000000..58a04c4
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bar_vs6_1.cpp
@@ -0,0 +1 @@
+#include "bar.cpp"
diff --git a/Tests/InterfaceLinkLibraries/bar_vs6_2.cpp b/Tests/InterfaceLinkLibraries/bar_vs6_2.cpp
new file mode 100644
index 0000000..58a04c4
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bar_vs6_2.cpp
@@ -0,0 +1 @@
+#include "bar.cpp"
diff --git a/Tests/InterfaceLinkLibraries/bar_vs6_3.cpp b/Tests/InterfaceLinkLibraries/bar_vs6_3.cpp
new file mode 100644
index 0000000..58a04c4
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bar_vs6_3.cpp
@@ -0,0 +1 @@
+#include "bar.cpp"
diff --git a/Tests/InterfaceLinkLibraries/bar_vs6_4.cpp b/Tests/InterfaceLinkLibraries/bar_vs6_4.cpp
new file mode 100644
index 0000000..58a04c4
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/bar_vs6_4.cpp
@@ -0,0 +1 @@
+#include "bar.cpp"
diff --git a/Tests/InterfaceLinkLibraries/foo.cpp b/Tests/InterfaceLinkLibraries/foo.cpp
new file mode 100644
index 0000000..5295707
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/foo.cpp
@@ -0,0 +1,15 @@
+
+#ifdef BAR_LIBRARY
+#error Unexpected BAR_LIBRARY
+#endif
+
+#ifdef BANG_LIBRARY
+#error Unexpected BANG_LIBRARY
+#endif
+
+#include "foo.h"
+
+int foo()
+{
+  return 0;
+}
diff --git a/Tests/InterfaceLinkLibraries/foo.h b/Tests/InterfaceLinkLibraries/foo.h
new file mode 100644
index 0000000..e12e23c
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/foo.h
@@ -0,0 +1,4 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int foo();
diff --git a/Tests/InterfaceLinkLibraries/foo_vs6_1.cpp b/Tests/InterfaceLinkLibraries/foo_vs6_1.cpp
new file mode 100644
index 0000000..d2e5e52
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/foo_vs6_1.cpp
@@ -0,0 +1 @@
+#include "foo.cpp"
diff --git a/Tests/InterfaceLinkLibraries/foo_vs6_2.cpp b/Tests/InterfaceLinkLibraries/foo_vs6_2.cpp
new file mode 100644
index 0000000..d2e5e52
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/foo_vs6_2.cpp
@@ -0,0 +1 @@
+#include "foo.cpp"
diff --git a/Tests/InterfaceLinkLibraries/foo_vs6_3.cpp b/Tests/InterfaceLinkLibraries/foo_vs6_3.cpp
new file mode 100644
index 0000000..d2e5e52
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/foo_vs6_3.cpp
@@ -0,0 +1 @@
+#include "foo.cpp"
diff --git a/Tests/InterfaceLinkLibraries/foo_vs6_4.cpp b/Tests/InterfaceLinkLibraries/foo_vs6_4.cpp
new file mode 100644
index 0000000..d2e5e52
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/foo_vs6_4.cpp
@@ -0,0 +1 @@
+#include "foo.cpp"
diff --git a/Tests/InterfaceLinkLibraries/main.cpp b/Tests/InterfaceLinkLibraries/main.cpp
new file mode 100644
index 0000000..a54076a
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/main.cpp
@@ -0,0 +1,19 @@
+
+#ifndef FOO_LIBRARY
+#error Expected FOO_LIBRARY
+#endif
+
+#ifndef BAR_LIBRARY
+#error Expected BAR_LIBRARY
+#endif
+
+#ifdef BANG_LIBRARY
+#error Unexpected BANG_LIBRARY
+#endif
+
+#include "bar.h"
+
+int main(void)
+{
+  return foo() + bar();
+}
diff --git a/Tests/InterfaceLinkLibraries/main_vs6_1.cpp b/Tests/InterfaceLinkLibraries/main_vs6_1.cpp
new file mode 100644
index 0000000..9b10ef2
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/main_vs6_1.cpp
@@ -0,0 +1 @@
+#include "main.cpp"
diff --git a/Tests/InterfaceLinkLibraries/main_vs6_2.cpp b/Tests/InterfaceLinkLibraries/main_vs6_2.cpp
new file mode 100644
index 0000000..9b10ef2
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/main_vs6_2.cpp
@@ -0,0 +1 @@
+#include "main.cpp"
diff --git a/Tests/InterfaceLinkLibraries/main_vs6_3.cpp b/Tests/InterfaceLinkLibraries/main_vs6_3.cpp
new file mode 100644
index 0000000..9b10ef2
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/main_vs6_3.cpp
@@ -0,0 +1 @@
+#include "main.cpp"
diff --git a/Tests/InterfaceLinkLibraries/main_vs6_4.cpp b/Tests/InterfaceLinkLibraries/main_vs6_4.cpp
new file mode 100644
index 0000000..9b10ef2
--- /dev/null
+++ b/Tests/InterfaceLinkLibraries/main_vs6_4.cpp
@@ -0,0 +1 @@
+#include "main.cpp"
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake
new file mode 100644
index 0000000..3e4144f
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake
@@ -0,0 +1,8 @@
+
+project(CMP0022-NOWARN-static)
+
+add_library(foo STATIC empty_vs6_1.cpp)
+add_library(bar STATIC empty_vs6_2.cpp)
+add_library(bat STATIC empty_vs6_3.cpp)
+target_link_libraries(foo bar)
+target_link_libraries(bar bat)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-static-result.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-static-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-stderr.txt
new file mode 100644
index 0000000..41d132c
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning \(dev\) in CMakeLists.txt:
+  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
+  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
+  cmake_policy command to set the policy and suppress this warning.
+
+  Static library target "bar" has a INTERFACE_LINK_LIBRARIES property.  This
+  should be preferred as the source of the link interface for this library.
+  Ignoring the property and using the link implementation as the link
+  interface instead.
+This warning is for project developers.  Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-static.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-static.cmake
new file mode 100644
index 0000000..b3cb131
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-static.cmake
@@ -0,0 +1,11 @@
+
+project(CMP0022-WARN)
+
+add_library(foo STATIC empty_vs6_1.cpp)
+add_library(bar STATIC empty_vs6_2.cpp)
+add_library(bat STATIC empty_vs6_3.cpp)
+set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES foo)
+set_property(TARGET bar PROPERTY LINK_LIBRARIES bat)
+
+add_library(user empty.cpp)
+target_link_libraries(user bar)
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
new file mode 100644
index 0000000..29103c9
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
@@ -0,0 +1,8 @@
+CMake Warning \(dev\) in CMakeLists.txt:
+  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
+  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
+  cmake_policy command to set the policy and suppress this warning.
+
+  Target "bar" has a INTERFACE_LINK_LIBRARIES property which differs from its
+  LINK_INTERFACE_LIBRARIES properties.
+This warning is for project developers.  Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
new file mode 100644
index 0000000..24b7f45
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
@@ -0,0 +1,11 @@
+
+project(CMP0022-WARN)
+
+add_library(foo SHARED empty_vs6_1.cpp)
+add_library(bar SHARED empty_vs6_2.cpp)
+add_library(bat SHARED empty_vs6_3.cpp)
+set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES foo)
+set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat)
+
+add_library(user empty.cpp)
+target_link_libraries(user bar)
diff --git a/Tests/RunCMake/CMP0022/CMakeLists.txt b/Tests/RunCMake/CMP0022/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
new file mode 100644
index 0000000..2e74f17
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0022-WARN)
+run_cmake(CMP0022-WARN-static)
+run_cmake(CMP0022-NOWARN-static)
diff --git a/Tests/RunCMake/CMP0022/empty.cpp b/Tests/RunCMake/CMP0022/empty.cpp
new file mode 100644
index 0000000..bfbbdde
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/empty.cpp
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int empty()
+{
+  return 0;
+}
diff --git a/Tests/RunCMake/CMP0022/empty_vs6_1.cpp b/Tests/RunCMake/CMP0022/empty_vs6_1.cpp
new file mode 100644
index 0000000..7efedab
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/empty_vs6_1.cpp
@@ -0,0 +1 @@
+#include "empty.cpp"
diff --git a/Tests/RunCMake/CMP0022/empty_vs6_2.cpp b/Tests/RunCMake/CMP0022/empty_vs6_2.cpp
new file mode 100644
index 0000000..7efedab
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/empty_vs6_2.cpp
@@ -0,0 +1 @@
+#include "empty.cpp"
diff --git a/Tests/RunCMake/CMP0022/empty_vs6_3.cpp b/Tests/RunCMake/CMP0022/empty_vs6_3.cpp
new file mode 100644
index 0000000..7efedab
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/empty_vs6_3.cpp
@@ -0,0 +1 @@
+#include "empty.cpp"
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index c1a08d2..e07c42f 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -52,6 +52,7 @@ if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 3)
 endif()
 
 add_RunCMake_test(CMP0019)
+add_RunCMake_test(CMP0022)
 add_RunCMake_test(CTest)
 if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles")
   add_RunCMake_test(CompilerChange)

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list