How to get output name that will be generated by a Target?

I want to get the path on disk of the artefact that will be produced by a target. I am using get_target_property() with OUTPUT_NAME property but this does not work. Reading the documentation it seems that this is a property which is set by the user. So this does not work because i want to get the default value that CMake uses if OUTPUT_NAME is not set.
Thanks in advance for any help

AFAIK this is only possible at generation step, so you’d have to use something from here: https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#target-dependent-queries I suppose.

I need it at configure step

1 Like

Maybe you can tell the problem you are trying to solve?

This doesn’t work in general because the OUTPUT_NAME could change after you query it. This is why it is, fundamentally, a generate-time thing. Knowing why you want to know this is likely to be more enlightening.