[cmake-developers] Policy for INTERFACE_LINK_LIBRARIES
Brad King
brad.king at kitware.com
Wed Nov 28 10:45:41 EST 2012
Hi Stephen,
I've looked through the add-INTERFACE_LINK_LIBRARIES-property topic. Unless
I'm misunderstanding something I think we can simplify CMP0019 quite a bit.
What made it complicated in earlier discussions was a desire to generate and
export INTERFACE_LINK_LIBRARIES even from projects that have not been modified
to be aware of it. However, your implementation does not reflect this, which
IMO is good.
In cmExport*.cxx you're generating INTERFACE_LINK_LIBRARIES only when CMP0019
is NEW in the producing project. Once the policy has been set to NEW then we
know the project has been modified and can assume the authors are aware of
CMake 2.8.11 and the policy. In that case we can assume they set or dropped
any old LINK_INTERFACE_LIBRARIES according to their own needs to support
consuming projects and older CMake versions.
I think we can drop the consumer-side policy completely. Consumers will load
imported targets with the old and/or new interfaces specified as chosen by the
producing project. CMake < 2.8.11 will just use the old interface. CMake >=
2.8.11 will just use the new interface if it is available and otherwise fall
back to the old. The burden of compatibility with existing consumer releases
falls on the authors modifying the producing project, just as with any other
change they make.
We can re-work CMP0019 to work purely in the producing (exporting) project.
If the policy is set to OLD we export only the old interface. If the policy
is set to NEW then we export the old and new interfaces. If the policy is not
set then we evaluate/compare the interfaces and warn if they are different,
but still export only the old interface.
I'm still not sure how we can eventually stop exporting the old interface.
Perhaps the export() and install(EXPORT) commands can learn new options
to specify the minimum supported version of CMake for their consumers.
We can wait and tackle this later though.
Thoughts?
-Brad
More information about the cmake-developers
mailing list