execute_process adds quotes that interfere with the command.
I need to execute the defaults
binary in macOS.
My code is:
EXECUTE_PROCESS(
COMMAND "/usr/bin/defaults" "read -g AppleLanguages"
OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/PERFORMOUS_LANG"
ERROR_VARIABLE PERFORMOUS_ERROR
COMMAND_ECHO "STDOUT"
ECHO_ERROR_VARIABLE
)
Which executes as following: '/usr/bin/defaults' 'read -g AppleLanguages'
And the output is empty. If I try to execute the command just like that on my terminal, I get the help menu because it can't recognize the arguments due to the quotes.