diff options
author | Alexander Harkness <bearbin@gmail.com> | 2014-09-10 18:50:18 +0200 |
---|---|---|
committer | Alexander Harkness <bearbin@gmail.com> | 2014-09-10 18:50:18 +0200 |
commit | 35a42fc4379a65a1bd278c98e2d98ce3bb85484f (patch) | |
tree | 9274410e1b775e72c64b7a0ca5652b3333606e0d /CMakeLists.txt | |
parent | Merge pull request #1402 from Masy98/Sounds (diff) | |
parent | Added example for how to use version info to travis (diff) | |
download | cuberite-35a42fc4379a65a1bd278c98e2d98ce3bb85484f.tar cuberite-35a42fc4379a65a1bd278c98e2d98ce3bb85484f.tar.gz cuberite-35a42fc4379a65a1bd278c98e2d98ce3bb85484f.tar.bz2 cuberite-35a42fc4379a65a1bd278c98e2d98ce3bb85484f.tar.lz cuberite-35a42fc4379a65a1bd278c98e2d98ce3bb85484f.tar.xz cuberite-35a42fc4379a65a1bd278c98e2d98ce3bb85484f.tar.zst cuberite-35a42fc4379a65a1bd278c98e2d98ce3bb85484f.zip |
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c47eb509..8f58f157a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,25 @@ if(DEFINED ENV{TRAVIS_BUILD_WITH_COVERAGE}) set(BUILD_WITH_COVERAGE $ENV{TRAVIS_BUILD_WITH_COVERAGE}) endif() +if(DEFINED ENV{BUILD_ID}) + set(BUILD_ID $ENV{BUILD_ID}) + set(BUILD_SERIES_NAME $ENV{BUILD_SERIES_NAME}) + set(BUILD_DATETIME $ENV{BUILD_DATETIME}) + if(DEFINED ENV{BUILD_COMMIT_ID}) + set(BUILD_COMMIT_ID $ENV{BUILD_COMMIT_ID}) + else() + message("Commit id not set, attempting to determine id from git") + execute_process( + COMMAND git rev-parse HEAD + RESULT_VARIABLE GIT_EXECUTED + OUTPUT_VARIABLE BUILD_COMMIT_ID) + string(STRIP ${BUILD_COMMIT_ID} BUILD_COMMIT_ID) + if (NOT (GIT_EXECUTED EQUAL 0)) + message(FATAL_ERROR "Could not identifiy git commit id") + endif() + endif() +endif() + # This has to be done before any flags have been set up. if(${BUILD_TOOLS}) add_subdirectory(Tools/MCADefrag/) |