mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-02-04 12:05:25 +00:00
19 lines
652 B
CMake
19 lines
652 B
CMake
set(PROJECTM_VCS_VERSION "Unknown" CACHE STRING "projectM version control revision number, e.g. Git commit hash")
|
|
|
|
# Currently only supporting Git.
|
|
find_package(Git)
|
|
|
|
if(Git_FOUND)
|
|
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
|
OUTPUT_VARIABLE _git_ref
|
|
ERROR_QUIET
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
)
|
|
|
|
if(NOT _git_ref STREQUAL "")
|
|
set(PROJECTM_VCS_VERSION "${_git_ref}" CACHE STRING "projectM version control revision number, e.g. Git commit hash" FORCE)
|
|
message(STATUS "Git revision: ${_git_ref}")
|
|
endif()
|
|
endif()
|