[CMake] How to deal with incompatible changes in interface of target_link_libraries()?

Brad King brad.king at kitware.com
Mon Aug 11 12:47:38 EDT 2014


On 08/09/2014 09:46 AM, Marcel Loose wrote:
> CMake 2.8.12 introduced the keywords PRIVATE, INTERFACE and PUBLIC, and
> immediately deprecated the LINK_INTERFACE_LIBRARIES keyword,
> triggering policy warnings CMP0022 and CMP0023.
> 
> What is the proper way to get rid of these policy warnings, while at
> the same time staying backward compatible with older CMake versions?

>From the documentation of CMP0022:

 "Warning-free future-compatible code which works with CMake 2.8.9
  onwards can be written by using the LINK_PRIVATE and LINK_PUBLIC
  keywords of target_link_libraries()."

Actually it should say 2.8.7, not 2.8.9.  CMP0023 docs mention 2.8.7.

-Brad


More information about the CMake mailing list