mirror of
https://github.com/open62541/open62541.git
synced 2025-06-03 04:00:21 +00:00
fix(build): Set git version number only when open62541 is the main CMake project
This commit disables reading the version number from git when open62541 is not the main CMake project. This is necessary when including the project via CPM, as the version number would get overwritten by the git tag of the main project.
This commit is contained in:
parent
0f945f0e4f
commit
b69f612e26
@ -48,9 +48,11 @@ set(OPEN62541_VER_PATCH 8)
|
||||
set(OPEN62541_VER_LABEL "-undefined") # like "-rc1" or "-g4538abcd" or "-g4538abcd-dirty"
|
||||
set(OPEN62541_VER_COMMIT "unknown-commit")
|
||||
|
||||
# Overwrite the version information based on git if available
|
||||
include(SetGitBasedVersion)
|
||||
set_open62541_version()
|
||||
# Overwrite the version information based on git if available and we are the main cmake project.
|
||||
if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
include(SetGitBasedVersion)
|
||||
set_open62541_version()
|
||||
endif()
|
||||
|
||||
# Examples for the version string are:
|
||||
# v1.2
|
||||
|
Loading…
Reference in New Issue
Block a user