diff options
author | FormerLurker <hochgebe@gmail.com> | 2020-11-21 02:57:11 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2020-11-21 02:57:11 +0300 |
commit | 66cc88f965f36fca1c07a4dedafad40f19b2825c (patch) | |
tree | fcefe47453e958b2d789ad14ffa91695b152f5ab | |
parent | 4f2fef2779e4cac3d31eb2ba4181416efb6a6bab (diff) |
Remove redundant cmake code
-rw-r--r-- | GcodeProcessorLib/CMakeLists.txt | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/GcodeProcessorLib/CMakeLists.txt b/GcodeProcessorLib/CMakeLists.txt index 1dfca4e..21fe511 100644 --- a/GcodeProcessorLib/CMakeLists.txt +++ b/GcodeProcessorLib/CMakeLists.txt @@ -2,44 +2,7 @@ cmake_minimum_required (VERSION "3.13") project(GcodeProcessorLib C CXX) -# create a version information header - version.h -# First get the current branch and store to GIT_BRANCH variable -execute_process( - COMMAND git rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE GIT_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE -) - -# get the current commit version -execute_process( - COMMAND git log -1 --format=%h - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE GIT_COMMIT_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE -) - -# get the most recent tagged version -execute_process( - COMMAND git describe --tags - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE GIT_TAGGED_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE -) - -# get the build date -string(TIMESTAMP BUILD_DATE "%Y-%m-%dT%H:%M:%SZ" UTC) -# get the copyright date -string(TIMESTAMP BUILD_YEAR "%Y" UTC) - -# add a definition so our libraries know that the version info is available -add_definitions("-DHAS_GENERATED_VERSION") -# Generate version.h CMAKE_BINARY_DIR -configure_file( - "${PROJECT_SOURCE_DIR}/version.generated.h.in" - "${CMAKE_BINARY_DIR}/version.generated.h" -) # create a version information header - version.h # First get the current branch and store to GIT_BRANCH variable execute_process( @@ -59,20 +22,12 @@ execute_process( # get the most recent tagged version execute_process( - COMMAND git describe + COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_TAGGED_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) -# get the tag for the current branch -execute_process( - COMMAND git describe --abbrev=0 - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE GIT_TAG - OUTPUT_STRIP_TRAILING_WHITESPACE -) - # get the build date string(TIMESTAMP BUILD_DATE "%Y-%m-%dT%H:%M:%SZ" UTC) # get the copyright date |