Thank you Sergei, but this is not what I asked.. I would like to set this variable during configuration step and get the same binary, that's means CMake should pass this variable to build tool (GNU Make, Ninja, ...).
From my point of view CMake should have such functionality. I can create a patch, but will be acceptable for merging? On 20.11.18 17:13, Sergei Nikulov wrote: > вт, 20 нояб. 2018 г. в 17:29, Oleh Kravchenko <o...@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, 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