mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2025-12-08 03:22:27 +08:00
cmake: relax git tag requirements
- default to v0.0.0 if tag isn't available - src/lib/px_update_git_header.py use same PX4_GIT_TAG as cmake - update lingering master branch references to main
This commit is contained in:
@@ -113,12 +113,20 @@ include(px4_parse_function_args)
|
||||
include(px4_git)
|
||||
|
||||
execute_process(
|
||||
COMMAND git describe --exclude ext/* --always --tags
|
||||
COMMAND git describe --exclude ext/* --tags --match "v[0-9]*"
|
||||
OUTPUT_VARIABLE PX4_GIT_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULTS_VARIABLE GIT_DESCRIBE_RESULT
|
||||
WORKING_DIRECTORY ${PX4_SOURCE_DIR}
|
||||
)
|
||||
|
||||
# if proper git tag unavilable default to v0.0.0
|
||||
if(NOT ${GIT_DESCRIBE_RESULT} MATCHES "0")
|
||||
set(PX4_GIT_TAG "v0.0.0")
|
||||
endif()
|
||||
|
||||
message(STATUS "PX4_GIT_TAG: ${PX4_GIT_TAG}")
|
||||
|
||||
# git describe to X.Y.Z version
|
||||
string(REPLACE "." ";" VERSION_LIST ${PX4_GIT_TAG})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user