ExternalProject_Add: clean BINARY_DIR with new download
I've found that it might cause problems when an external project gets updated:
- there is a new download, sources are updated
- configure/build steps run, but due to the previous contents in BINARY_DIR might not update its output (since e.g. libfoo.a is still newer than the new source(s))
Therefore I think it makes sense to clean the BINARY_DIR if the download step was invoked. This could be optional, but should probably default to ON then.
I'm doing this manually now in an (already existing/used) DOWNLOAD_COMMAND now:
file(REMOVE_RECURSE ${BINARY_DIR})
file(MAKE_DIRECTORY ${BINARY_DIR})
Edited by Daniel Hahler