16 lines
469 B
CMake
16 lines
469 B
CMake
# Copyright (C) 2021,2022 fef <owo@fef.moe>. All rights reserved.
|
|
|
|
find_package(Git QUIET)
|
|
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
|
execute_process(
|
|
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
|
|
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
|
OUTPUT_VARIABLE gaybsd_GIT_REVISION
|
|
ERROR_QUIET
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
)
|
|
|
|
if (NOT "${gaybsd_GIT_REVISION}" STREQUAL "")
|
|
set(gaybsd_VERSION_SUFFIX "-${gaybsd_GIT_REVISION}")
|
|
endif()
|
|
endif()
|