[CMake] cmake install behaviour with git

Nils Gladitz nilsgladitz at gmail.com
Thu Oct 1 04:28:21 EDT 2015


On 10/01/2015 10:12 AM, Jörg Kreuzberger wrote:
> -----Ursprüngliche Nachricht-----
> Von:	Nils Gladitz <nilsgladitz at gmail.com>
> Gesendet:	Do 01.10.2015 09:40
> Betreff:	Re: [CMake] cmake install behaviour with git
> An:	Jörg Kreuzberger <j.kreuzberger at procitec.de>; cmake at cmake.org;
>> On 10/01/2015 08:35 AM, Jörg Kreuzberger wrote:
>>> This comes from installs, there we install some configuration files with the
>> builded targets.
>>> e.g. you install a builded executable, together with an config xml file from
>> SCM.
>>> If you make a product install, you want to "overwrite" the original config
>> xml with an "product" xml config
>>> file, also from the SCM.
>>>
>>> So there are two install steps, the second "configure/modify" some files of
>> the first. This worked cause the file
>>> timestamps differed. Now not, cause the second install gets "Up-to-date"
>> message and has to use CMAKE_ALWAYS_INSTALL.
>>
>> I don't comprehend this at all.
>> Why would the two instances of the config file with distinct content
>> have the same modification time in this scenario?
>
> cause they come from git clone and git sets the timestamp of the files to the time of the clone,
> not of the "original" modification time. So after a clone all files(!) have the same timestamp.

Subversion does not restore "original" modification times either (unless 
you use the non-default 'use-commit-times' option which likely breaks 
timestamp logic in the build).

When you do a fresh checkout with subversion all files will have 
modification times close to each other as well.

I guess the only difference with git is that git might be a bit faster 
when creating files to a degree where creation time differences might 
fall below the modification time precision(?)

What was unclear to me is that it now sounds like you are installing two 
distinct files from your repository to the same destination file rather 
than re-installing a modified version of the same file.

I think that is conceptually an error prone thing to do irregardless of 
the SCM in use.

Nils




More information about the CMake mailing list