tqcq
7d7845acb5
Some checks failed
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (push) Waiting to run
linux-arm-gcc / linux-gcc-arm (Debug) (push) Waiting to run
linux-arm-gcc / linux-gcc-arm (Release) (push) Waiting to run
linux-arm-gcc / linux-gcc-armhf (Debug) (push) Waiting to run
linux-arm-gcc / linux-gcc-armhf (Release) (push) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Waiting to run
linux-x64-clang / linux-clang (Debug) (push) Waiting to run
linux-x64-clang / linux-clang (Release) (push) Waiting to run
linux-x64-gcc / linux-gcc (Debug) (push) Waiting to run
linux-x64-gcc / linux-gcc (Release) (push) Waiting to run
linux-x86-gcc / linux-gcc (Debug) (push) Waiting to run
linux-x86-gcc / linux-gcc (Release) (push) Waiting to run
android / build (push) Failing after 7m1s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (push) Has been cancelled
37 lines
859 B
CMake
37 lines
859 B
CMake
# - Returns a version string from Git tags
|
|
#
|
|
# This function inspects the annotated git tags for the project and returns a string
|
|
# into a CMake variable
|
|
#
|
|
# get_git_version(<var>)
|
|
#
|
|
# - Example
|
|
#
|
|
# include(GetGitVersion)
|
|
# get_git_version(GIT_VERSION)
|
|
#
|
|
# Requires CMake 2.8.11+
|
|
find_package(Git)
|
|
|
|
if(__get_git_version)
|
|
return()
|
|
endif()
|
|
set(__get_git_version INCLUDED)
|
|
|
|
function(get_git_version var)
|
|
if(GIT_EXECUTABLE)
|
|
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --match "v[0-9]*.[0-9]*.[0-9]*" --abbrev=8 --dirty
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
RESULT_VARIABLE status
|
|
OUTPUT_VARIABLE GIT_VERSION
|
|
ERROR_QUIET)
|
|
if(status)
|
|
set(GIT_VERSION "v0.0.0")
|
|
endif()
|
|
else()
|
|
set(GIT_VERSION "v0.0.0")
|
|
endif()
|
|
|
|
set(${var} ${GIT_VERSION} PARENT_SCOPE)
|
|
endfunction()
|