find_program issue with space in filename

I have the following code:

find_program(
    RECON_EXE
    NAMES "Reason Recon" "Reason Recon 11 RESDK41 Logging"
    PATHS "/Applications/Reason Recon" "/Applications" "c:/Program Files/Propellerhead/Reason Recon"
)
message(STATUS "RECON_EXE=${RECON_EXE}")

And the output is

RECON_EXE=/Applications/Reason Recon 11 RESDK41 Logging.app/Contents/MacOS/Reason%20Recon

The actual filename does not have a %20 character but a space instead.

The issue is that using

add_custom_target(validate
    COMMAND ${RECON_EXE} ....
)

then fails:

/bin/sh: /Applications/Reason Recon 11 RESDK41 Logging.app/Contents/MacOS/Reason%20Recon: No such file or directory

Is this an issue with find_program or is it something I am doing wrong?

Thanks
Yan

That looks like a bug to me. Could you please report it in CMake’s issue tracker:

https://gitlab.kitware.com/cmake/cmake/-/issues

As you suggested, I opened a ticket https://gitlab.kitware.com/cmake/cmake/-/issues/20817

Thanks