Page MenuHome

Use cmake TIMESTAMP for BUILD_DATE+TIME
ClosedPublic

Authored by Bernhard M. Wiedemann (bmwiedemann) on Wed, Sep 11, 3:58 PM.

Details

Summary

Use cmake TIMESTAMP for BUILD_DATE+TIME
this simplifies code a lot
and even makes it more portable to other platforms

TIMESTAMP is available since cmake-2.8.11 ; blender already requires
cmake>=3.5 so that is fine.

Diff Detail

Repository
rB Blender

Event Timeline

Patch LGTM, wouldn't mind double-check from @Campbell Barton (campbellbarton) though.

build_files/cmake/buildinfo.cmake
148–150

Well, since you are correcting that comment, this is not true anymore - BUILD_TIME and _DATE are now also taken from CMake, unless overridden by matching BUILDINFO_OVERRIDE_TIME/_DATE settings.

This revision is now accepted and ready to land.Wed, Sep 11, 5:45 PM

Also, is CMake's TIMESTAMP taking into account the SOURCE_DATE_EPOCH envvar?

Also, is CMake's TIMESTAMP taking into account the SOURCE_DATE_EPOCH envvar?

It does with cmake>=3.8 as documented in https://reproducible-builds.org/docs/source-date-epoch/#reading-the-variable

Can someone please improve and/or land this patch?

I’ll do it this week (and update the api doc generation script accordingly to use Blender's build date instead, too). But this is not a top-priority task either, we all have tens of things to do…

Current minimum CMake version is 3.5, although this is usable w/o SOURCE_DATE_EPOCH, so seems OK.