views:

38

answers:

2

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.

A: 

What is the custom behavior you are looking for? If you need to remove files you can use set_directory_properties.

RobertJMaynard
I edited my question to elaborate on the custom behavior.
paleozogt
Fortunately, the external tool I'm using can be configured to put everything in one directory, which allows me to use set_directory_properties. :)
paleozogt
A: 

See http://www.cmake.org/pipermail/cmake/2006-October/011477.html

It may help.

Jason