[cmake-developers] CMake 2.8.12 transitive link regression?

Brad King brad.king at kitware.com
Thu Oct 31 15:43:54 EDT 2013


On 10/31/2013 03:40 PM, Brad King wrote:
>   if(explicitLibraries)
>     {
>     ...
>     }
>   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.

Prior to 2.8.12 this was just "else" with no policy test.
This should still be the case.  Then when exporting the old
properties you need this:

   if (iface->ImplementationIsInterface)
     {
-    this->SetImportLinkProperty(suffix, target,
+    if(!newCMP0022Behavior || this->ExportOld)
+      {
+      this->SetImportLinkProperty(suffix, target,
                                 "IMPORTED_LINK_INTERFACE_LIBRARIES",
                                 iface->Libraries, properties, missingTargets);
+      }
     return;
     }

which basically says that the link implementation is used as
the old link interface properties when CMP0022 is not NEW
or we've been explicitly told to export the old properties.

The hard part is in exporting the new link interface property
in cmExportFileGenerator::PopulateInterfaceLinkLibrariesProperty
which is not per-config but the link implementation is per-config.

Ideas?
-Brad



More information about the cmake-developers mailing list