diff --git a/CMakeLists.txt b/CMakeLists.txt index b119dee..a6f17b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,26 +44,25 @@ IF (GIT_FOUND) ERROR_QUIET WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) - EXECUTE_PROCESS( COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty=-dev - OUTPUT_VARIABLE GIT_TAG + OUTPUT_VARIABLE VERSION_GIT_TAG OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) ENDIF () -IF ("${GIT_TAG}" STREQUAL "") +IF ("${VERSION_GIT_TAG}" STREQUAL "") STRING(TIMESTAMP COMPILE_TIME %Y-%m-%d_%H:%M:%S) SET(VERSION_GIT_TAG ${COMPILE_TIME}) ELSE () - SET(VERSION_GIT_TAG ${GIT_TAG}) + SET(VERSION_GIT_TAG ${VERSION_GIT_TAG}) ENDIF () CONFIGURE_FILE(prj_config.h.in prj_config.h) -MESSAGE("Version: " ${VERSION_GIT_TAG}) +MESSAGE("Git Tag: " ${VERSION_GIT_TAG}) IF (USED_LWIP) LIST(APPEND COMMON_DEFINE "-DLWIP_ON") diff --git a/srcs/CMakeLists.txt b/srcs/CMakeLists.txt index 9eb6ceb..748ae82 100644 --- a/srcs/CMakeLists.txt +++ b/srcs/CMakeLists.txt @@ -83,5 +83,10 @@ INSTALL(TARGETS ${PROJECT_TARGET} RUNTIME DESTINATION bin) SET(CPACK_GENERATOR "TGZ") -SET(CPACK_PACKAGE_FILE_NAME "vCPE-${VCPE_VERSION}-linux-amd64_${VERSION_GIT_HASH_SHORT}") +IF ("${VERSION_GIT_HASH_SHORT}" STREQUAL "") + SET(CPACK_PACKAGE_FILE_NAME "vCPE-${VCPE_VERSION}-linux-amd64_${VERSION_GIT_TAG}") +ELSE () + SET(CPACK_PACKAGE_FILE_NAME "vCPE-${VCPE_VERSION}-linux-amd64_${VERSION_GIT_HASH_SHORT}") +ENDIF () + INCLUDE(CPack) \ No newline at end of file