[cmake-developers] ENV{SOURCE_DATE_EPOCH}

Sergei Nikulov sergey.nikulov at gmail.com
Tue Nov 20 10:13:47 EST 2018


вт, 20 нояб. 2018 г. в 17:29, Oleh Kravchenko <oleg at kaa.org.ua>:
>
> Hello CMake Developers,
>
> My use case is to use UNIX timestamp from git history to setup
> SOURCE_DATE_EPOCH and get the same binary.
> I would like to set SOURCE_DATE_EPOCH environment variable from CMake
> during configuration step.
>
> How I can do it?

As per manual https://cmake.org/cmake/help/latest/command/set.html
set(ENV{SOURCE_DATE_EPOCH} <value>...)
should work during configuration step.

Should not work during build step when you invoke make or ninja.

> -- Best regards, Oleh Kravchenko
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake-developers



-- 
Best Regards,
Sergei Nikulov


More information about the cmake-developers mailing list