On Friday 30 November 2012, Stephen Kelly wrote: > Brad King wrote: > > On 11/29/2012 02:22 PM, David Cole wrote: > >> But with the multiple "OR" technique, if there is a single target name > >> clash, NONE of the targets will be included properly > > > > Good catch. I read it as "AND", which it should be: > > if(TARGET a AND TARGET b AND ...) > > > > return() > > > > endif() > > I've pushed an implementation of 'all or none or warning' to next as the > branch safe-target-file-import.
we'll hit that case if a Config file for the same package has already been loaded in a project. Typically a FooConfig.cmake file will have something like: include("${CMAKE_CURRENT_LIST_DIR}/FooTargets.cmake") With the return() in the FooTargets.cmake file, this included file will simply do nothing, and we'll stay with the "old" imported targets and their properties. But the FooConfig.cmake file which has just been executed may set a bunch of variables, which would fit to the targets which now have not been imported, and which do not fit to the previuosly imported targets. Should the FooConfig.cmake fail in this case ? Probably not. Should it silently do nothing at all ? Or should it set the variables it wants to set but not touch the imported targets ? I'm not sure what the best way is. Comments ? 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