diff --git a/CMakeLists.txt b/CMakeLists.txt index f25f65ab..aa531bfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ if(NOT GIT_COMMIT_HASH) endif() find_package(Git) if(Git_FOUND) - execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 + execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE gch) if(gch) set(GIT_COMMIT_HASH "${gch}") @@ -29,6 +29,10 @@ if(NOT GIT_COMMIT_HASH) endif() endif() endif() #git +if(PACKAGING) + add_definitions(-DPKG=1) +endif() + add_library(clio) target_compile_features(clio PUBLIC cxx_std_20) diff --git a/src/main/impl/Build.cpp b/src/main/impl/Build.cpp index b42d6e28..b59b0a37 100644 --- a/src/main/impl/Build.cpp +++ b/src/main/impl/Build.cpp @@ -31,6 +31,9 @@ char const* const versionString = "1.0.2" #ifdef SANITIZER BOOST_PP_STRINGIZE(SANITIZER) #endif +#endif +#ifdef PKG + "-release" #endif //--------------------------------------------------------------------------