-
set version using git describe + cmakedev/etc 2021. 3. 29. 20:51
v2.5-0-gdeadbee
^ ^ ^^
| | | |
| | | '-- SHA of HEAD (first seven chars)
| | '-- "g" is for git
| '---- number of commits since last tag
|
'--------- last tagstackoverflow.com/a/12368262/3543411
How can I get my C code to automatically print out its Git version hash?
Is there an easy way to write C code that can access its Git version hash? I wrote software in C to collect scientific data in a laboratory setting. My code records the data it collects in a .yam...
stackoverflow.com
softwareengineering.stackexchange.com/a/141986
How do you achieve a numeric versioning scheme with Git?
My organization is considering moving from SVN to Git. One argument against moving is as follows: How do we do versioning? We have an SDK distribution based on the NetBeans Platform. As the SVN
softwareengineering.stackexchange.com
linux.die.net/man/1/git-describe
git-describe(1) - Linux man page
git-describe(1) - Linux man page Name git-describe - Show the most recent tag that is reachable from a commit Synopsis git describe [--all] [--tags] [--contains] [--abbrev= ] ... git describe [--all] [--tags] [--contains] [--abbrev= ] --dirty[= ] Descripti
linux.die.net
cmake
execute_process(COMMAND ${GIT_EXECUTABLE} describe --abbrev=4 --always --tags --long --dirty OUTPUT_VARIABLE _VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET RESULT_VARIABLE ret) target_compile_definitions(${PROJECT_NAME} PUBLIC _VERSION="${_VERSION}")
cmake.org/cmake/help/latest/command/execute_process.html
execute_process — CMake 3.20.0 Documentation
execute_process Execute one or more child processes. execute_process(COMMAND [ ] [COMMAND [ ]]... [WORKING_DIRECTORY ] [TIMEOUT ] [RESULT_VARIABLE ] [RESULTS_VARIABLE ] [OUTPUT_VARIABLE ] [ERROR_VARIABLE ] [INPUT_FILE ] [OUTPUT_FILE ] [ERROR_FILE ] [OUTPUT
cmake.org
cmake.org/cmake/help/latest/command/target_compile_definitions.html
target_compile_definitions — CMake 3.20.0 Documentation
target_compile_definitions Add compile definitions to a target. target_compile_definitions( [items1...] [ [items2...] ...]) Specifies compile definitions to use when compiling a given . The named must have been created by a command such as add_executable()
cmake.org