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

Vivek Goel goelvivek2011 at gmail.com
Wed Oct 17 15:24:45 EDT 2012


Sorry as my post was not clear enough.
I think my problem is not cmake specific. But may be I can get some better
solution here.

Using CMake I am generating a common version file.
version.h which contains current svn version of source code.
In all application main.c I am including this file.
Now every application is depending on this version.h
and everything got rebuild.

I want to change this logic so application will have their own version and
version.h file should be generated only if any other dependency of
application is changed.




Now as
regards
Vivek Goel



On Thu, Oct 18, 2012 at 12:40 AM, Andreas Pakulat <apaku at gmx.de> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121018/394112c9/attachment.htm>


More information about the CMake mailing list