Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake uninstall target #1151

Closed
duncanspumpkin opened this issue Nov 8, 2022 · 0 comments · Fixed by #1215
Closed

CMake uninstall target #1151

duncanspumpkin opened this issue Nov 8, 2022 · 0 comments · Fixed by #1215

Comments

@duncanspumpkin
Copy link

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)
Megamouse pushed a commit to Megamouse/yaml-cpp that referenced this issue Sep 25, 2023
jbeder added a commit that referenced this issue Oct 11, 2023
… be disabled by YAML_CPP_DISABLE_UNINSTALL

add_custom_target uninstall causes a clash with the same target in rtmidi (https://github.com/thestk/rtmidi).
"add_custom_target cannot create target "uninstall" because another target with the same name already exists.  The existing target is a custom target created in source directory"

Adds new option YAML_CPP_DISABLE_UNINSTALL 

fixes #1151

---------

Co-authored-by: Megamouse <studienricky89@googlemail.de>
Co-authored-by: Jesse Beder <jbeder+github@gmail.com>
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 a pull request may close this issue.

1 participant