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

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to