diff -up ./CMakeLists.txt.orig ./CMakeLists.txt --- ./CMakeLists.txt.orig 2017-03-19 13:11:32.426142255 +0100 +++ ./CMakeLists.txt 2017-03-19 13:15:02.626150970 +0100 @@ -17,8 +17,13 @@ if (WIN32) execute_process(COMMAND cmd /c echo %DATE% %TIME% OUTPUT_VARIABLE TIMESTAMP OUTPUT_STRIP_TRAILING_WHITESPACE) else (WIN32) - execute_process(COMMAND date "+%F %T%z" OUTPUT_VARIABLE TIMESTAMP + if(DEFINED ENV{SOURCE_DATE_EPOCH}) + execute_process(COMMAND date -d "@$ENV{SOURCE_DATE_EPOCH}" "+%F %T%z" OUTPUT_VARIABLE TIMESTAMP OUTPUT_STRIP_TRAILING_WHITESPACE) + else() + execute_process(COMMAND date "+%F %T%z" OUTPUT_VARIABLE TIMESTAMP + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() endif (WIN32) add_definitions (-DCMAKE -DVERSION=\"${VERSION}\" -DTIMESTAMP=\"${TIMESTAMP}\")