[cmake-developers] Adding automatic checks for required targets in target-export files ?

Alexander Neundorf neundorf at kde.org
Sun Feb 17 13:08:43 EST 2013


On Sunday 17 February 2013, Alexander Neundorf wrote:
> On Sunday 17 February 2013, Brad King wrote:
> > On 2/16/2013 12:32 PM, Alexander Neundorf wrote:
> > > There's another try now in ConfigFileTargetChecks5.
> > > The export-file now warns if a target does not exist, but does not
> > > error out.
> > 
> > I think in light of the discussion in the other thread,
> > "Setting target properties before the target is defined",
> > there is a valid use case for the dependencies to not
> > exist when the target will not be used anyway.  We do
> > not know the final intention until generation time.
> 
> The ConfigFileTargetChecks5 now uses a directory property.
> It still emits the warning if a referenced target does not exist yet in the
> targets-file, I think this is a good thing, packages should be
> find_package()'ed by their order of dependencies.
> 
> Updated generated file is attached.

There is now also a simple test, as part of ExportImport/.
It checks the case that the required packages are imported in the wrong order.

I haven't yet figured out a good way how to add a test which tests the error 
case. Is there a better way than duplicating most of ExportImport/ ?

Thanks
Alex



More information about the cmake-developers mailing list