Skip to content

Commit

Permalink
cmake: fix tag extraction, again
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasVautherin committed Feb 8, 2019
1 parent 562257c commit 8556877
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ set(dronecode_sdk_install_include_dir "include/dronecode_sdk")
set(dronecode_sdk_install_lib_dir ${lib_path})

execute_process(
COMMAND git describe --abbrev=8 --dirty --always --tags | sed 's/v\\([0-9]*\\.[0-9]*\\.[0-9]*.*$\\)/\\1/'
COMMAND git describe --abbrev=8 --dirty --always --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE VERSION_STR
OUTPUT_STRIP_TRAILING_WHITESPACE
)

STRING(REGEX REPLACE v\([0-9]+.[0-9]+.[0-9]+.*$\) \\1 VERSION_STR ${VERSION_STR})

message(STATUS "Version: ${VERSION_STR}")
add_definitions(-DDRONECODE_SDK_VERSION="${VERSION_STR}")

Expand Down

0 comments on commit 8556877

Please sign in to comment.