parent
990f60b160
commit
d4003c0a88
|
@ -10,13 +10,19 @@ EXECUTE_PROCESS(COMMAND git describe --tags --always --dirty=-dev
|
||||||
|
|
||||||
if ("${GIT_TAG}" STREQUAL "")
|
if ("${GIT_TAG}" STREQUAL "")
|
||||||
STRING(TIMESTAMP COMPILE_TIME %Y-%m-%d_%H:%M:%S)
|
STRING(TIMESTAMP COMPILE_TIME %Y-%m-%d_%H:%M:%S)
|
||||||
SET(GIT_TAG ${COMPILE_TIME})
|
SET(GIT_VERSION ${COMPILE_TIME})
|
||||||
else ()
|
else ()
|
||||||
|
EXECUTE_PROCESS(COMMAND git rev-parse --short HEAD
|
||||||
|
OUTPUT_VARIABLE GIT_HASH)
|
||||||
|
|
||||||
STRING(REGEX REPLACE "\n$" "" GIT_TAG ${GIT_TAG})
|
STRING(REGEX REPLACE "\n$" "" GIT_TAG ${GIT_TAG})
|
||||||
|
STRING(REGEX REPLACE "\n$" "" GIT_HASH ${GIT_HASH})
|
||||||
|
|
||||||
|
SET(GIT_VERSION ${GIT_TAG}_${GIT_HASH})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
MESSAGE("Version: " ${GIT_TAG})
|
MESSAGE("Version: " ${GIT_VERSION})
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(srcs)
|
ADD_SUBDIRECTORY(srcs)
|
||||||
ADD_SUBDIRECTORY(srcs/libs)
|
ADD_SUBDIRECTORY(srcs/libs)
|
||||||
|
|
|
@ -23,7 +23,7 @@ AUX_SOURCE_DIRECTORY(hardware C_SRC)
|
||||||
|
|
||||||
SET(CMAKE_C_STANDARD 99)
|
SET(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
ADD_DEFINITIONS(-DBUILD_VERSION="${GIT_TAG}")
|
ADD_DEFINITIONS(-DBUILD_VERSION="${GIT_VERSION}")
|
||||||
|
|
||||||
LINK_LIBRARIES(${COMMON_LIBS})
|
LINK_LIBRARIES(${COMMON_LIBS})
|
||||||
ADD_LIBRARY(${LIB_PROJECT_TARGET} ${C_SRC} ${C_HEADS})
|
ADD_LIBRARY(${LIB_PROJECT_TARGET} ${C_SRC} ${C_HEADS})
|
Loading…
Reference in New Issue