@@ -159,9 +159,9 @@ The above will work with either GNU or BSD date, and fallback to ignore `SOURCE_
STRING(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC)
```
... works with CMake versions 2.8.11 and higher, but it only respects
`SOURCE_DATE_EPOCH` since version 3.8.0. If you do not have a modern CMake but
need reproducibility you can use the less-preferred variant:
... will compile with CMake versions 2.8.11 and higher ([released May 2013](https://cmake.org/pipermail/cmake/2013-May/054792.html)), but it only respects `SOURCE_DATE_EPOCH` since version 3.8.0 ([April 2017](https://cmake.org/pipermail/cmake-developers/2017-April/029946.html)). Note that the final argument `UTC` is required or the timestamp may vary between timezones.
If you would like to support legacy/archival versions of CMake, you can use this less-preferred variant:
```
if (DEFINED ENV{SOURCE_DATE_EPOCH})
@@ -177,8 +177,7 @@ else ()
endif ()
```
The above will work only with GNU `date`. See the POSIX shell example on how to
support BSD date.
Note that the above will work only with GNU `date`; see the POSIX shell example on how to support BSD date.