separate_arguments would fail whenever there would be a space in CMAKE_C_COMPILER, including on Linux.
According to CMake docs, add_custom_command does not guarantee a bash environment. Currently, this is not a problem on Linux, but on Windows we get cmd.exe trying to execute :. With my changes, bash is executed explicitly and it will work even on windows, provided bash.exe is somewhere in PATH.