[CMake] Automatic building app version if any one of the dependency is changed.

Andreas Pakulat apaku at gmx.de
Wed Oct 17 15:10:30 EDT 2012


Hi,

On Wed, Oct 17, 2012 at 9:02 PM, Vivek Goel <goelvivek2011 at gmail.com> wrote:
> Hi,
> I am buidilng 5 binary using cmake.
> Currently I am using svn source code version as app version for the
> application but it does not scale enough because if any file changed it
> force building of all the binary.
> Is there a way I can generate application specific version file only if any
> dependency of app executable is changed ?

Can you post example cmake code of how you're doing things? I'm not
quite understanding what you currently do and what exact behaviour you
see. Basically when you setup a target in CMake with a list of source
files, then that target is only rebuilt if one of the sources changes.
How this change is detected depends on the generator you use, for
example the Makefile generator will check the modification timestamps
of the files. So if svn changes the modification times of files on
every update then you're screwed when using makefiles. Find out why
that happens (are you maybe using an $Id$ tag in your source files?)
and fix that or switch to another generator.

Andreas


More information about the CMake mailing list