File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.1)
22project (RTLSDR-Airband CXX)
33
4- execute_process (COMMAND git describe --tags --abbrev --dirty --always
4+ execute_process (COMMAND ${PROJECT_SOURCE_DIR} /scripts/find_version
55 OUTPUT_VARIABLE RTL_AIRBAND_VERSION
66 OUTPUT_STRIP_TRAILING_WHITESPACE
77 ERROR_VARIABLE RTL_AIRBAND_VERSION_ERROR
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ WORKDIR /rtl_airband_build
4545# WARNING: not copying in the whole repo, this may need to be updated if build files are added outside of src/
4646COPY ./.git/ .git/
4747COPY ./src/ src/
48+ COPY ./scripts/ scripts/
4849COPY ./CMakeLists.txt .
4950
5051# configure and build
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ PROJECT_ROOT_PATH=" $( cd $( dirname " $0 " ) /../ ; pwd) "
4+ PROJECT_GIT_DIR_PATH=" ${PROJECT_ROOT_PATH} /.git"
5+ PROJECT_DIR_NAME=" $( basename ${PROJECT_ROOT_PATH} ) "
6+
7+ # if there is a .git directory at the project root then rely on git for the version string
8+ if [ -d " ${PROJECT_GIT_DIR_PATH} " ] ; then
9+ git describe --tags --abbrev --dirty --always
10+ exit 0
11+ fi
12+
13+ # if the proejct root directory matches the naming convetion of an extracted archive then
14+ # get the version number out of that
15+ if [[ " ${PROJECT_DIR_NAME} " =~ ^RTLSDR-Airband-[0-9]* \. [0-9]* \. [0-9]* $ ]]; then
16+ echo ${PROJECT_DIR_NAME} | cut -d ' -' -f 3
17+ exit 0
18+ fi
19+
20+ # print an error string to stderr (any output to stdout is considered success)
21+ >&2 echo " did not find a git root directory at ${PROJECT_GIT_DIR_PATH} and failed to extract a version from ${PROJECT_DIR_NAME} "
You can’t perform that action at this time.
0 commit comments