Чистка

This commit is contained in:
Andrei Astafev 2021-06-17 15:48:21 +03:00
parent d8c4257a0c
commit ff55360937
2 changed files with 7 additions and 7 deletions

View File

@ -5,10 +5,12 @@ elseif(ARGV0)
set(output_file ${ARGV0}) set(output_file ${ARGV0})
endif() endif()
add_custom_target(git-version ALL ${CMAKE_COMMAND} # cmake-format: off
-DCMLIB_PROJECT_NAME_UPPER=${CMLIB_PROJECT_NAME_UPPER} add_custom_target(git-version ALL
${CMAKE_COMMAND} -DCMLIB_PROJECT_NAME_UPPER=${CMLIB_PROJECT_NAME_UPPER}
-DCMLIB_MODULE_DIR=${CMLIB_MODULE_DIR} -DCMLIB_MODULE_DIR=${CMLIB_MODULE_DIR}
-DCMLIB_GIT_VERSION_FILE=${output_file} -P ${CMLIB_MODULE_DIR}/CMLibGitVersion.cmake -DCMLIB_GIT_VERSION_FILE=${output_file} -P ${CMLIB_MODULE_DIR}/CMLibGitVersion.cmake
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
# cmake-format: on
unset(output_file) unset(output_file)

View File

@ -3,8 +3,6 @@ set(CMLIB_GIT_DIFF "")
set(CMLIB_GIT_TAG "N/A") set(CMLIB_GIT_TAG "N/A")
set(CMLIB_GIT_BRANCH "N/A") set(CMLIB_GIT_BRANCH "N/A")
message("aaaaaa")
find_program(GIT_EXECUTABLE git) find_program(GIT_EXECUTABLE git)
if(GIT_EXECUTABLE) if(GIT_EXECUTABLE)
execute_process(COMMAND git log --pretty=format:'%h' -n 1 OUTPUT_VARIABLE CMLIB_GIT_REV ERROR_QUIET) execute_process(COMMAND git log --pretty=format:'%h' -n 1 OUTPUT_VARIABLE CMLIB_GIT_REV ERROR_QUIET)
@ -18,7 +16,7 @@ if(GIT_EXECUTABLE)
execute_process(COMMAND git rev-parse --abbrev-ref HEAD OUTPUT_VARIABLE CMLIB_GIT_BRANCH) execute_process(COMMAND git rev-parse --abbrev-ref HEAD OUTPUT_VARIABLE CMLIB_GIT_BRANCH)
string(STRIP "${CMLIB_GIT_REV}" CMLIB_GIT_REV) string(STRIP "${CMLIB_GIT_REV}" CMLIB_GIT_REV)
string(SUBSTRING "${CMLIB_GIT_REV}" 1 8 CMLIB_GIT_REV) string(SUBSTRING "${CMLIB_GIT_REV}" 1 7 CMLIB_GIT_REV)
string(STRIP "${CMLIB_GIT_DIFF}" CMLIB_GIT_DIFF) string(STRIP "${CMLIB_GIT_DIFF}" CMLIB_GIT_DIFF)
string(STRIP "${CMLIB_GIT_TAG}" CMLIB_GIT_TAG) string(STRIP "${CMLIB_GIT_TAG}" CMLIB_GIT_TAG)
string(STRIP "${CMLIB_GIT_BRANCH}" CMLIB_GIT_BRANCH) string(STRIP "${CMLIB_GIT_BRANCH}" CMLIB_GIT_BRANCH)