CMake uninstall target
envgap__jbeder__yaml-cpp-1151
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
4c061a5058721795b6851b593b09bac7763b92c8- Manifest
CMakeLists.txt- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
jbeder/yaml-cpp #1151 · read the original issue
The uninstall target in the project is always shown even if you don't have the install target. It should really be gated behind the `${YAML_CPP_INSTALL}`. As a workaround in my projects I have been adding a dummy target before fetching yaml-cpp to prevent this:
```
# Get rid of yaml uninstall target
add_library(uninstall INTERFACE)
set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "")
set(YAML_CPP_BUILD_TOOLS OFF CACHE BOOL "")
set(YAML_CPP_BUILD_CONTRIB OFF CACHE BOOL "")
set(YAML_BUILD_SHARED_LIBS OFF CACHE BOOL "")
set(YAML_CPP_INSTALL OFF CACHE BOOL "")
set(YAML_CPP_FORMAT_SOURCE OFF CACHE BOOL "")
FetchContent_Declare(
yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp
GIT_TAG 1b50109f7bea60bd382d8ea7befce3d2bd67da5f
)
FetchContent_MakeAvailable(yaml-cpp)
```04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]