Hey all,
You may have seen my earlier posts, "find_package" and INTERFACE targets
in 3.0" and "Target usage requirements for shared libraries". I've also
seen Michael Darling's post "Package found - passing _INCLUDE_DIRS to
include_directories() and _LIBRARIES to target_link_libraries()", so I'm
assuming there's a fair bit of interest in this topic.
After wrestling with it for about a week, I've got a solution that I
think works very well, and demonstrates how to properly make use of
INTERFACE and IMPORTED targets with the new Usage Requirements
Paradigm. I've made a couple of helper functions for generating
interface targets from the information exported by Find modules, as well
as a couple of example find modules demonstrating their use with pure
header, static, and shared libraries, and even one which uses a master
INTERFACE target to control link library ordering. I've put the files up
on github for you guys to take a look at. I would really appreciate any
feedback you may have on how I could make it any clearer or further
reduce code duplication between the find modules.
https://github.com/wal-rus/cmake-modules
--
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