[CMake] [ANNOUNCE] CMake 3.1.0-rc1 now ready for testing!

Hendrk Sattler post at hendrik-sattler.de
Wed Oct 29 12:04:41 EDT 2014


Am 2014-10-28 19:16, schrieb Robert Maynard:
> * The "FindZLIB" module now provides imported targets.

Either the provided modules go the whole way for imported target or they 
just don't provide them.
However:
113 if(ZLIB_FOUND)
114     set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
115     set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
116
117     if(NOT TARGET ZLIB::ZLIB)
118       add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
119       set_target_properties(ZLIB::ZLIB PROPERTIES
120         IMPORTED_LOCATION "${ZLIB_LIBRARY}"
121         INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
122     endif()
123 endif()

This is not quite the solution anybody dreamed of.
This is only usable on e.g. Linux. And there, the advantage of an 
imported target is minimal because the zlib include is 99,99% in the 
standard include path, anyway.

Where is the .dll on Windows here?
Why is IMPORTED_IMPLIB not used properly?

Same probably goes for most (all?) imported target from standard CMake 
find modules, e.g. FindQt4 also gets this wrong.

Additionally, I might want to have an imported target available 
globally. How do I do this with targets from find modules?
Why do I need that: To get a list of linked libraries from a target and 
obtain the runtime library (.dll on Windows) from that list.

:-(

HS



More information about the CMake mailing list