On Monday 17 September 2012, Brad King wrote:
> On 09/17/2012 03:35 PM, Alexander Neundorf wrote:
> > Let's say FooTargets.cmake provides the target foo.
> > 
> > BarTargets.cmake provides the target bar, and requires FooTargets.cmake.
> > 
> > Now if the user installed the bar-devel package, but not the foo-devel
> > package, the target foo will not be available.
> > This can or should be checked also outside maybe in the BarConfig.cmake
> > cmake, which could load BarTargets.cmake only if Foo could be found, but
> > still I think it's not necessary to abort in this error case.
> 
> What would you do instead of aborting?  Silently pretend the package
> Bar was not found at the current Bar_DIR and move on with the search?
> That would require the sandboxing I previously elaborated.  It would
> also be confusing to users IMO because the package they know is in
> their search path would be skipped for a mysterious reason.

Isn't e.g. FindPNG.cmake doing just the same ?
If zlib wasn't found, fail at finding png.

Here we are again at generating error messages...

Instead of simply stating that a required target does not exist, it could also 
state from which installed export this is expected to come, e.g. 
FooTargets.cmake.

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

Reply via email to