[cmake-developers] [PATCH] FindPNG: Create an imported PNG::PNG target

Brad King brad.king at kitware.com
Wed Jan 20 14:05:58 EST 2016


On 01/20/2016 11:57 AM, rleigh at codelibre.net wrote:
>>> + INTERFACE_LIBRARIES "${PNG_LIBRARIES}")
> 
> I would have expected something like
> 
>   set_target_properties(PNG::PNG PROPERTIES INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)

Yes.

> after all of the "if(EXISTS... add imported link interface/location"
> blocks, so you get the appropriate zlib library.  Certainly, I don't think
> PNG_LIBRARIES is appropriate to use for any of the imported targets,
> otherwise the system-specific zlib library path is going to get embedded
> in exported configuration when you call install(... EXPORT) to export the
> library configuration for find_package.  I'd just use PNG_LIBRARY here and
> then add the dependencies as imported targets.

Thanks for the review, Roger.  I've reverted the topic from 'next'
awaiting revisions from Sam as discussed here.

This PNG -> ZLIB dependency is particularly important to get right because
this relationship is commonly used as an example of how find modules should
handle dependencies.

> As an aside, I've found some limitations 

I've split the thread with a separate response to this part.

-Brad


More information about the cmake-developers mailing list