On 02/09/2011 04:24 PM, Johan Björk wrote: > Hi everyone, > > There seems to be quite a few requests to be able to iterate over all the > targets > http://www.cmake.org/pipermail/cmake/2010-September/039379.html > http://www.mail-archive.com/[email protected]/msg09544.html > http://www.mail-archive.com/[email protected]/msg33947.html > > I haven't seen any changes or bug reports allowing this.. has anyone > considered adding it? > > My usecase is a bit different then the others. I have a common 'core' > library that itself contains a bunch of static libraries. We have several > targets that utilize this common core, and for our iPhone target, I must set > a certain XCode attribute for all targets. > While overriding the add_library() call works, it feels like an ugly hack. > > Thanks > /Johan
Then don't override it, wrap it in a function instead. This is semantically clearer (if you give it a good name) and has the advantage that it's clear what's going on. Iterating over a list of targets to modify properties in a possibly distant part of the build system isn't very transparent IMHO. That's not to say I wouldn't like to have a way of obtaining a list of targets defined so far... Michael _______________________________________________ cmake-developers mailing list [email protected] http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
