Including CTest in the top-level CMakeLists.txt sets BUILD_TESTING=ON for parent projects
envgap__skypjack__entt-609
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
3d5905c87855059ac564be11b4bdb9e047aec2f7- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
skypjack/entt #609 · read the original issue
#### What is the issue you have?
`BUILD_TESTING` is unset in the main project.
skypjack_entt is included in a main project using FetchContent.
`ENTT_BUILD_TESTING=OFF` is set in the main project.
skypjack_entt's top-level CMakeLists.txt includes CTest regardless.
`BUILD_TESTING=ON` is now set in the main project.
#### Please describe the steps to reproduce the issue.
```
message(STATUS "before BUILD_TESTING := ${BUILD_TESTING}") # prints ""
include(FetchContent)
FetchContent_Declare(
skypjack_entt
GIT_REPOSITORY https://github.com/skypjack/entt.git
GIT_TAG master)
set(ENTT_BUILD_TESTING OFF)
FetchContent_MakeAvailable(skypjack_entt)
message(STATUS "after BUILD_TESTING := ${BUILD_TESTING}") # prints ON
```
#### What is the expected behavior?
CTest should only be included if skypjack_entt is the main project.
#### And what is the actual behavior instead?
CTest is included although skypjack_entt is added as subproject.04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]