kern/cmake/git.cmake
fef 5a5135f416
update license terms
As of now, everything except the code imported
from FreeBSD is proprietary.  Of course, it won't
be like this for long, only until we have decided
which license we like to use.  The rationale is
that releasing everything under a copyleft license
later is always easier than doing so immediately
and then changing it afterwards.
Naturally, any changes made before this commit are
still subject to the terms of the CNPL.
2021-11-15 19:23:22 +01:00

16 lines
464 B
CMake

# Copyright (C) 2021 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()