Skip to content

Fix library version when used as a CMake subproject - #1188

Open
ktyang512 wants to merge 1 commit into
BehaviorTree:masterfrom
ktyang512:fix/cmake-project-version-1119
Open

Fix library version when used as a CMake subproject#1188
ktyang512 wants to merge 1 commit into
BehaviorTree:masterfrom
ktyang512:fix/cmake-project-version-1119

Conversation

@ktyang512

Copy link
Copy Markdown

Fixes #1119.

Problem

BTCPP_LIBRARY_VERSION used CMAKE_PROJECT_VERSION, which is the top-level
project version. When BehaviorTree.CPP was added with add_subdirectory() or
FetchContent, the library could therefore report the parent project's version.

Change

Use BehaviorTree.CPP's directory-scoped PROJECT_VERSION and add a CMake
regression that configures the library below a parent project with a different
version.

Validation

  • Regression failed before the fix with BTCPP_LIBRARY_VERSION="9.8.7".
  • Regression passes after the fix with BTCPP_LIBRARY_VERSION="4.10.0".
  • Standalone Release build passes.
  • Full serial CTest passes: 505/505.
  • pre-commit run -a --show-diff-on-failure passes.
  • ./run_clang_tidy.sh build-docker-clang21-ci passes in an Ubuntu 24.04
    Docker container with clangd-21 21.1.8.

@ktyang512 ktyang512 closed this Aug 11, 2026
@ktyang512 ktyang512 reopened this Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BTCPP_LIBRARY_VERSION can be set uncorrectly

1 participant