mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2025-12-01 12:11:20 +00:00
18 lines
600 B
CMake
18 lines
600 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
|
|
)
|
|
|
|
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()
|