Skip to content

WIP: cmRulePlaceholderExpander: Add access to targets properties

Beren Minor requested to merge berenm/cmake:target-property-in-commands into master

Using <TARGET_PROPERTY:<prop>> expressions, it is now possible to access a target's property (or the corresponding CMAKE_<prop> global variable fallback) in CMAKE_<lang>_LINK_EXECUTABLE and similar commands.

The value of the target properties is itself expanded again, so a bit of recursion is possible.

This allows to pass additional parameters for custom toolchains that use post-processing steps with additional files per target when creating applications.

--

I don't really know what is the state of "complex" expressions in the CMAKE_<lang>_LINK_EXECUTABLE (and SHARED/MODULE variants), or how it conflicts with generator expressions.

My knowledge of CMake's internals is very limited and this is the simplest way I could solve my problem. Let me know if I'm misleading.

Also, I have no idea where to add unit tests for this kind of feature, or how to integrate them in the project. Is there any information about it somewhere?

Edited by Beren Minor

Merge request reports