You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
469 B
CMake
17 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()
|