[cmake-developers] EXPORT_NAME-genex
Brad King
brad.king at kitware.com
Mon May 20 10:03:34 EDT 2013
On 05/20/2013 09:48 AM, Stephen Kelly wrote:
> Brad King wrote:
>
>> What's so bad about the exported targets being called "boost_..."
>> instead of "boost::..."?
>
> A stronger indication that it is an imported target. boost::... can only be
> an imported target, but boost_... could be an imported target, a in-build
> target or a library.
Other than for error message generation, what does knowing whether a
target is imported or not matter? Abstracting that away has value too.
See below.
> As we discussed in another thread, we can check for '::' to see if it is an
> imported target and error if that imported target is not available.
Yes, it allows better error messages in some cases.
>> VTK and ITK have worked that way for years.
>> It is simpler if the name inside the upstream build matches that in
>> the downstream consumers.
>
> Why is that simpler?
>
> By the same logic, is it simpler for the target name to match the output
> name? Should the OUTPUT_NAME property exist?
Those are different namespaces: logical target name v. on-disk file name.
Both in-build and imported targets are logical target names.
Originally OUTPUT_NAME was created for cases when the build system could
not handle logical target names matching the desired on-disk file name.
This was important for re-producing behavior when converting from other
build systems.
> cost:
> * Projects may wish to have a different in-build name than exported name.
> * Anything else?
We commonly write test/example directories that work either in-build
or as an outside project. How to do this when the target name changes?
It will need target aliases which adds even more complexity.
-Brad
More information about the cmake-developers
mailing list