File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,23 @@ include_directories(
2323 ${SDL_INCLUDE_DIRS}
2424 ${TBB_INCLUDE_DIRS}
2525)
26+ execute_process (COMMAND git rev-parse --verify HEAD
27+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR} "
28+ OUTPUT_VARIABLE GIT_SHA1
29+ ERROR_QUIET
30+ OUTPUT_STRIP_TRAILING_WHITESPACE)
2631
27- add_definitions (-DXRCORE_EXPORTS)
32+ message ( "commit: " ${GIT_SHA1} )
33+
34+ execute_process (COMMAND git rev-parse --abbrev-ref HEAD
35+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR} "
36+ OUTPUT_VARIABLE GIT_BRANCH
37+ ERROR_QUIET
38+ OUTPUT_STRIP_TRAILING_WHITESPACE)
39+
40+ message ( "branch: " ${GIT_BRANCH} )
41+
42+ add_definitions (-DXRCORE_EXPORTS -DGIT_INFO_CURRENT_COMMIT="${GIT_SHA1} " -DGIT_INFO_CURRENT_BRANCH="${GIT_BRANCH} " )
2843add_library (${PROJECT_NAME} SHARED ${${PROJECT_NAME} __SOURCES} ${${PROJECT_NAME} __INCLUDES})
2944
3045set_target_properties (${PROJECT_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h" )
You can’t perform that action at this time.
0 commit comments