Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard M. Wiedemann <bwiedemann@suse.de>2019-09-18 21:35:16 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-09-19 00:04:23 +0300
commitea6c9f17bd4929f55632345a8c2173c59b78b22b (patch)
tree6444f89ff7b36f4ca1e78147799d9ed2dba759d2
parent6f7a64b57fcb235461146b6953ed7a30166c4a56 (diff)
Use cmake TIMESTAMP for BUILD_DATE+TIME
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. Note that with CMake>=3.8, if defined, the SOURCE_DATE_EPOCH envvar will be used by CMake here. Reviewers: mont29, campbellbarton Reviewed By: mont29, campbellbarton Differential Revision: https://developer.blender.org/D5760
-rw-r--r--build_files/cmake/buildinfo.cmake21
1 files changed, 6 insertions, 15 deletions
diff --git a/build_files/cmake/buildinfo.cmake b/build_files/cmake/buildinfo.cmake
index ec43534528a..cef6b94ee2e 100644
--- a/build_files/cmake/buildinfo.cmake
+++ b/build_files/cmake/buildinfo.cmake
@@ -145,22 +145,13 @@ if(EXISTS ${SOURCE_DIR}/.git)
unset(_git_changed_files)
endif()
-# BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
+# BUILD_PLATFORM is taken from CMake
# but BUILD_DATE and BUILD_TIME are platform dependent
-if(UNIX)
- if(NOT BUILD_DATE)
- execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
- endif()
- if(NOT BUILD_TIME)
- execute_process(COMMAND date "+%H:%M:%S" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
- endif()
-elseif(WIN32)
- if(NOT BUILD_DATE)
- execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
- endif()
- if(NOT BUILD_TIME)
- execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
- endif()
+if(NOT BUILD_DATE)
+ STRING(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC)
+endif()
+if(NOT BUILD_TIME)
+ STRING(TIMESTAMP BUILD_TIME "%H:%M:%S" UTC)
endif()
# Write a file with the BUILD_HASH define