On Friday 24 February 2012, Brad King wrote: > On 2/24/2012 5:31 AM, Stephen Kelly wrote: > > When building with Qt5, we want to change the convention away from USE > > files, and towards a concept of using packages whose variables have > > conventional names, mostly those conventions in the Modules/readme.txt, > > so that after find_package(Foo), Foo_INCLUDE_DIRS contains the include > > directories that targets using Foo need to use, and > > Foo_COMPILE_DEFINITIONS contains the compile definitions that they need > > etc. This would also be an incentive for other packages to follow the > > convention. > > Sounds good. > > > macro(cmake_use_package _target _package) > > Rather than upstreaming a macro like that I'd rather see effort made > toward first-class "usage requirements" support in CMake. The new > per-target include directories was a big step necessary to achieve it. > > Basically targets (and imported targets) should have new properties > on them that propagate information to application targets that link > to them. Currently CMake handles transitive linking requirements > automatically but not other requirements such as COMPILE_DEFINITIONS > and INCLUDE_DIRECTORIES. This will require C++ implementation but > will be much more powerful than the proposed macro. Just the simple > > target_link_libraries(A B) > > command would be enough to propagate B's requirements while compiling > A's source files. I can go into more detail upon request.
I agree. Except one thing (we discussed this already several times I think), I would prefer a dedicated command for this, so it is obvious to the reader that the command does more than just linking, e.g.: target_use_package(A B) Alex -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers