On Monday 14 October 2013, Brad King wrote: > On 10/13/2013 6:03 AM, Alexander Neundorf wrote: ... > > I'd like to remove the --find-package mode, which was my attempt to make > > cmake packages easier to use by non-cmake projects. > > The idea was that you can use cmake --find-package JPEG similar to > > pkg-config, i.e. call it from handwritten makefiles or autoconf, and it > > prints the include dirs, link dirs and libs to link to stdout so they > > are handed as options to the compiler. > > To do that, it is/was relying on a set of standard variables > > (Foo_LIBRARIES, Foo_INCLUDE_DIRS and some slight variations) being set > > by Find-modules/Config files. > > Since it was recently decided that it is fine to recommend using imported > > target names directly and not to set the standard variables anymore, I > > don't see how I could improve this in the future. > > So instead I'd like to remove it instead of keeping a somewhat broken, > > sometimes working feature around. which is not used widely. > > Can't the --find-package mode evaluate the locations of targets named > in the _LIBRARIES variables? In general it will have to evaluate full > generator expressions too. I thought the idea of --find-package was > to do all the transformations that CMake would do before putting the > targets on the command line and then hand the result back.
Yes, that was the idea, but I can't rely anymore on a Foo_LIBRARIES variable (or a slight variation) being set after a successful find_package(Foo): http://lists.kde.org/?l=kde-core-devel&m=138198795723680&w=2 I.e. in the future there will be Find-modules which typically export one of (Foo|FOO)_(LIBRARIES|LIBRARY), some Config.cmake files which do that too, and a big number, probably majority, of Config.cmake files, which do not export such variables. The only chance I see would be to simply collect all library targets and return what they provide, but this doesn't feel good. I would have much prefered using a clear interface like the Foo_LIBRARIES variable. 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