[cmake-developers] ExternalProject and git clone
Daniele E. Domenichelli
daniele.domenichelli at gmail.com
Thu Sep 5 08:28:09 EDT 2013
Hello,
I'm trying to use ExternalProject to create something like a
"super-build" that downloads and builds the dependencies (from svn, git
and url) and a few modules of my project (in git repositories), but I
have a major issue:
I'd like to be able to modify files, commit, and push from the external
git repositories, therefore I'm downloading them in a different
directory from the build directory. Unfortunately if I want to rebuild
from the start and I delete the build directory, the repository is
deleted because the time stamps are missing, and then cloned again next
time I run make, due to these lines:
execute_process(
COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\"
RESULT_VARIABLE error_code
)
that are executed unconditionally when gitclone_infofile is newer than
gitclone_stampfile.
Therefore all my changes, branches, additional remotes, etc would be
lost. Also no warning is given to the user that the directory is being
deleted, and this behaviour doesn't seem to be documented anywhere.
I would like to try to write a patch that modifies this behaviour
somehow, for example:
* Skip the clone phase if the source_dir exists and is not in the build
directory
* Have a bool property to skip the clone phase if the directory exists
* Just skip the clone if the directory exists
Does it seem reasonable? Do you think that this could cause other issues?
Regards,
Daniele
More information about the cmake-developers
mailing list