mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
CMake: Check Git commit SHA1
This is for PandaSystem::get_git_commit()
This commit is contained in:
parent
2d5d1400be
commit
399f4a33a1
@ -73,6 +73,16 @@ set(PANDA_VERSION_SYMBOL panda_version_${PROJECT_VERSION_MAJOR}_${PROJECT_VERSIO
|
||||
# for each component.
|
||||
math(EXPR PANDA_NUMERIC_VERSION "${PROJECT_VERSION_MAJOR}*1000000 + ${PROJECT_VERSION_MINOR}*1000 + ${PROJECT_VERSION_PATCH}")
|
||||
|
||||
# The Panda Git SHA1 refspec, for PandaSystem::get_git_commit()
|
||||
find_package(Git QUIET)
|
||||
if(GIT_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE PANDA_GIT_COMMIT_STR
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
# Separate the plugin version into its three components.
|
||||
string(REPLACE "." ";" P3D_PLUGIN_VERSION_LIST "${P3D_PLUGIN_VERSION}")
|
||||
list(GET P3D_PLUGIN_VERSION_LIST 0 P3D_PLUGIN_MAJOR_VERSION)
|
||||
|
@ -49,6 +49,10 @@
|
||||
out from CVS by the builder). */
|
||||
#define PANDA_VERSION_STR "@PANDA_VERSION_STR@"
|
||||
|
||||
/* This is the Git commit we built Panda from, or an empty string if this isn't
|
||||
known. */
|
||||
#define PANDA_GIT_COMMIT_STR "@PANDA_GIT_COMMIT_STR@"
|
||||
|
||||
/* This is the version of the Panda3D ABI expressed as a string.
|
||||
This usually means the major and minor version. It should be the
|
||||
same for Panda3D versions that are supposed to be backward
|
||||
|
Loading…
x
Reference in New Issue
Block a user