I really don’t like using execute_process unless I have to. Because execute_process is done during the configure stage of cmake. To me a very quick configure stage is really important. Adding too much logic to your configure step slows down iteration speed which is crucial for rapid development/testing. Also execute_process tends to be slower on Windows (Why is cmake on Linux so much faster than on Windows?) depending on what you are doing.
I like using add_custom_command since it happens during the build step and can be parallelized. Even if your custom task is single threaded the build can still potentially be running other tasks and whatnot.
Overall my opinion is:
1.) Make sure you really need to do this in the first place. Get another person’s opinion.
2.) Document what you are doing. Make sure other people understand what your custom build task is doing.
3.) Choose add_custom_command over execute_process if possible