In my CMake project I'd like to have some custom behavior happen when the clean target is run. However, if I do
add_dependencies(clean extra-clean)
it fails with
add_dependencies Adding dependency to non-existent target: clean
Is it even possible to have custom clean behavior?
EDIT: I am running some external tools as part of the build. These tools generate lots of files, but they can be cleaned up simply by asking the tool to do so. Ideally, I could add a custom target to the clean target to call the tool to do its cleanup.
What is the custom behavior you are looking for? If you need to remove files you can use set_directory_properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With