I guess add_custom_command
expects so called “cmake-style paths”. You can use file(TO_CMAKE_PATH)
to convert a native Windows path into a cmake-style path (see https://cmake.org/cmake/help/latest/command/file.html#path-conversion for more details).
It is also advised to always double-quote paths, since some function might interpret a single path containing spaces as several space-separated arguments.
I hope this helps!