'How to specify a command to clean a custom cmake target?

I have made a custom target in cmake by using add_custom_target and it compiles some HLSL shaders for me. However, when I clean the target using visual studio it does not delete the compiled files. How do I specify a command to delete the compiled shader files?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source