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
I posted this question in the forum first (https://discourse.cmake.org/t/find-program-issue-with-space-in-filename/1365) and was told to open a ticket.