Here's a custom command we find in the CMake documentation:
add_custom_command(
TARGET foo POST_BUILD
COMMAND someHasher -i "$<TARGET_FILE:myExe>"
-o "$<TARGET_FILE:myExe>.hash"
VERBATIM)
suppose that, instead of adding .hash
, I want to replace any existing extension with .hash
. I would need some way to strip the extension from $<TARGET_FILE:myExe>
... how should I do this? Can I do better than full-blown regexp matching?