4 changed files with 80 additions and 34 deletions
@ -1,3 +1,3 @@
|
||||
FROM gcc |
||||
RUN apt update |
||||
RUN apt -y install cmake valgrind |
||||
RUN apt -y install cmake valgrind git |
||||
|
@ -0,0 +1,21 @@
|
||||
MIT License |
||||
|
||||
Copyright (c) 2019 Arwed Mett |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
SOFTWARE. |
@ -0,0 +1,37 @@
|
||||
execute_process( |
||||
COMMAND git rev-parse --abbrev-ref HEAD |
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} |
||||
OUTPUT_VARIABLE GIT_BRANCH |
||||
OUTPUT_STRIP_TRAILING_WHITESPACE |
||||
) |
||||
|
||||
execute_process( |
||||
COMMAND git log -1 --format=%h |
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} |
||||
OUTPUT_VARIABLE GIT_COMMIT_HASH |
||||
OUTPUT_STRIP_TRAILING_WHITESPACE |
||||
) |
||||
|
||||
execute_process( |
||||
COMMAND git tag -l --points-at HEAD |
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} |
||||
OUTPUT_VARIABLE GIT_CURRENT_VERSION |
||||
OUTPUT_STRIP_TRAILING_WHITESPACE |
||||
ERROR_QUIET |
||||
) |
||||
|
||||
execute_process( |
||||
COMMAND git describe --abbrev=0 --tags |
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} |
||||
OUTPUT_VARIABLE GIT_OLD_VERSION |
||||
OUTPUT_STRIP_TRAILING_WHITESPACE |
||||
ERROR_QUIET |
||||
) |
||||
|
||||
if(GIT_OLD_VERSION MATCHES "[0-9]+.[0-9]+.[0-9]+") |
||||
message(STATUS "Using project version ${GIT_OLD_VERSION}") |
||||
set(PROJECT_VERSION "${GIT_OLD_VERSION}") |
||||
else() |
||||
message(STATUS "Using project version 0.0.0") |
||||
set(PROJECT_VERSION "0.0.0") |
||||
endif() |
Loading…
Reference in new issue