[cmake-developers] Alias targets for 2.8.12
Brad King
brad.king at kitware.com
Thu Aug 1 09:20:00 EDT 2013
On 08/01/2013 05:26 AM, Stephen Kelly wrote:
> it would be useful for KDE Frameworks to have ALIAS targets in CMake 2.8.12.
>
> http://thread.gmane.org/gmane.comp.kde.devel.core/80233/focus=80247
>
> I finished the topic and pushed it to next in case it can go into that
> release.
>
> I won't be available most of today to change it if needed, but I can fix it
> up tomorrow if needed.
The topic looks like a great start. I won't promise to take it
for 2.8.12 yet but let's proceed with review.
- The documentation in add_library and add_executable lists a bunch
of things one can't do but not an example of what one can do.
I think this documentation should have an explicit list of what
is intended and allowed and then exclude everything else. That
way if we missed a use case we can treat it as a bug later and
add the error case.
- Should add_executable be (dis)allowed to add a library alias,
and vice-versa for add_library?
- The documentation does not mention that alias targets cannot be
installed or exported.
- Add more "positive" use cases (or "negative" if not allowed)
to the test suite:
- add_custom_command/add_custom_target COMMAND argv0 translation
- add_test NAME/COMMAND signature argv0 translation
- generator expression references e.g. $<TARGET_FILE:...> in
add_test and add_custom_* commands
- Alias for an object library with $<TARGET_OBJECTS:...>
- Look for other uses of cmMakefile FindTargetToUse and
FindTarget; all of them need tests for alias behavior and/or
should be preceded by !IsAlias checks (many are already done).
- How does this interact with $<TARGET_PROPERTY:NAME>?
- When "if(TARGET xyz)" returns true how can one tell from CMake
code whether xyz is an alias or a real target? Can one get the
real target if it is an alias?
Thanks,
-Brad
More information about the cmake-developers
mailing list