<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">Den fre 12 okt. 2018 00:24Matt Schulte <<a href="mailto:schultetwin1@gmail.com">schultetwin1@gmail.com</a>> skrev:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah, that's a good tip Elvis. The CONFIGURE_DEPENDS on the .git/index<br>
would do the trick. I can set that up for now.<br>
<br>
In the long run, its not that ideal because it forces a reconfigure on<br>
every commit (which is annoying for developers at their desk).<br>
<br>
My example above is actually a little more complex in real life. I<br>
just simplified it for this e-mail. We only append the git hash to our<br>
version string if we are on certain branches. So our version string<br>
doesn't change on feature branches.<br>
<br>
For now I think we'll bite the bullet and re-configure on every<br>
commit. I'll keep mulling over the how to set this up. Thanks for the<br>
idea!<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes, I should have mentioned this downside. In our case it was acceptable as our configuration step is rather quick.</div><div dir="auto"><br></div><div dir="auto">Tangential note from me re. developer experience: Yesterday I tried out zapcc for local development, and it really is fast:</div><div dir="auto"><br></div><div dir="auto"> <a href="https://github.com/yrnkrn/zapcc">https://github.com/yrnkrn/zapcc</a></div><div dir="auto"><br></div><div dir="auto">Takes a bit of memory of course.</div><div dir="auto"><br></div><div dir="auto">Elvis</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-Matt<br>
On Thu, Oct 11, 2018 at 12:26 PM Chuck Atkins <<a href="mailto:chuck.atkins@kitware.com" target="_blank" rel="noreferrer">chuck.atkins@kitware.com</a>> wrote:<br>
><br>
><br>
>> COMMAND "${GIT_EXECUTABLE}" describe --always HEAD<br>
><br>
><br>
> git describe is nice way to do it since you can get a monotonic-ish increasing version number<br>
><br>
><br>
>><br>
>> string(REGEX REPLACE "^.*-(.*)-g.*$" "\\1" MYAPP_VERSION_MICRO "${MYAPP_VERSION}")<br>
>> ...<br>
>> set(MYAPP_VERSION_MICRO "0")<br>
><br>
><br>
> Only tangentially related, CMake commands and functions that deal with version information refer to the 4th component as _TWEAK.<br>
><br>
> - Chuck<br>
><br>
</blockquote></div></div></div>