[CMake] rebuild externalprojects

Alexander Neundorf a.neundorf-work at gmx.net
Mon Oct 2 15:31:43 EDT 2017


On 2017 M09 21, Thu 07:18:46 CEST David Cole via CMake wrote:
> By manually deleting (or touching) the stamp file associated with the
> earliest step you need to re-run.
> 
> ExternalProject is not for auto-detecting changes to stuff and
> minimally re-running build steps. It's for static stuff that doesn't
> change much.
> 
> Find the "-build" stamp file that's associated with the project
> containing the source you changed and delete it.
> 
> Then run the build from the top and that one and everything that
> depends on it afterwards should rebuild.

so, if I have an "external project" as sources in my project (i.e. it is not updated from some 
other repository or something), and if then that package is upgraded to the next version, 
what's the recommended way to enforce a rebuild of it ?

I have only found two clunky work-arounds: if it's a cmake-based project, I just add 
--no-warn-unused-cli -DREBUILD_FLAG=123
to CMAKE_ARGS, and increase this "REBUILD_FLAG" whenever a rebuild is necessary.
What also seems to work is to misuse the
URL_MD5, and set it to the date of the last update, e.g.
URL_MD5=20171002

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171002/a5ecac55/attachment-0001.html>


More information about the CMake mailing list