this is about a legacy code snippet for a build procedure I have limited knowledge on. I am trying to understand the location by observation, to make adjustments accordingly.
I do understand that the provided solution by Craig must be implemented afterwards.
The part that is confusing me here is the documentation:
For a non-imported target, this property is provided for compatibility
with CMake 2.4 and below. It was meant to get the location of an
executable target’s output file for use in |add_custom_command|.
tgt is a non-imported target. It states that this property was used in CMake <= 2.4 for custom commands. It implies that this property is automatically set in later versions.
[…] In CMake 2.6 and above
|add_custom_command| automatically recognizes a target name in its
DEPENDS options and computes the target location. In
CMake 2.8.4 and above |add_custom_command| recognizes
generator expressions <cmake-generator-expressions(7)>
to refer to target locations anywhere in the command.
Therefore this property is not needed for creating custom commands.
For CMake >= 2.8.4 usage for this purpose is discouraged.
CMP0026 is marked deprecated for 3.17 but the old behaviour hasn’t been dropped yet.