BTCPP_LIBRARY_VERSION can be set uncorrectly
envgap__BehaviorTree__BehaviorTree.CPP-1119
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
c88a9f429a421b312599a07fa8902524b09bf90a- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
BehaviorTree/BehaviorTree.CPP #1119 · read the original issue
**Describe the bug**
BTCPP_LIBRARY_VERSION can get the value of CMAKE_PROJECT_VERSION from the project parent.
```
grep -rnHe "BTCPP_LIBRARY_VERSION"
src/behavior_tree.cpp:118: auto const parts = splitString(BTCPP_LIBRARY_VERSION, '.');
src/behavior_tree.cpp:127: return BTCPP_LIBRARY_VERSION;
CMakeLists.txt:257:target_compile_definitions(${BTCPP_LIBRARY} PUBLIC BTCPP_LIBRARY_VERSION="${CMAKE_PROJECT_VERSION}")
```
**How to Reproduce**
I'm not totally sure how to reproduce.
Inside a CMakeList.txt:
```
FetchContent_Declare(
BehaviorTree
GIT_REPOSITORY https://github.com/BehaviorTree/BehaviorTree.CPP.git
GIT_TAG 4.6.2)
FetchContent_MakeAvailable(BehaviorTree)
```
Compiling in verbose mode, you can see different values :
- Either get the GIT_TAG of another FetchContent_Declare
```
... -DBTCPP_LIBRARY_VERSION=\"0.11.1\"
```
- or a dummy value:
```
... -DBTCPP_LIBRARY_VERSION=\"\"
```
- or even:
```
... -DBTCPP_LIBRARY_VERSION=\"1.0.0\"
```04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]