On 30. Dec, 2009, at 18:02 , Jed Brown wrote: > On Wed, 30 Dec 2009 17:51:29 +0100, Michael Wild <them...@gmail.com> wrote: >> >> On 30. Dec, 2009, at 17:32 , Jed Brown wrote: >> >>> On Mon, 28 Dec 2009 12:29:05 +0100, Pau Garcia i Quiles >>> <pgqui...@elpauer.org> wrote: >>>> I'm using CMake 2.8.0 on Linux. Yes, Michael is right: I want it to >>>> happen automagically. That was the whole point of this thread :-) >>> >>> I would argue that FindXXX.cmake is the wrong place for the decision to >>> be made since I may want my project to link different targets >>> differently (as with pkg-config's --static option). >>> >>> Jed >> >> That would be a rather unusual choice (IMHO). What would be your >> preferred way of doing this with CMake? > > I realize it is much different than how CMake currently operates (where > libraries are a lower-level concept than in e.g. pkg-config), but I > don't believe it's a strange thing to want a project to link different > targets differently. > > Jed
I don't think this will ever work easily, since the user can (and should) be able to specify a specific library in the cache. Your request would require that every library, for every target, gets a separate cache entry. If you have more than just ~10 targets, the number of cache entries will just explode and become very confusing to the user. Worse, you might actually run into serious trouble due to transitive linking (say target library A links against the external library foo, and B links against both A and also foo. Now, if the user doesn't know that the author of the CMakeLists.txt made a mistake, and choses different versions of the foo library for A and B, all hell breaks lose... Your right, in old-school autohell projects using pkg-config it is possible to do such things, but then the user had no option of overriding that choice. Just my 2c. Michael _______________________________________________ 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://www.cmake.org/mailman/listinfo/cmake