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

[value-ptr-lite] Package config naming differs from package name #19448

Closed
redpandamonium opened this issue Aug 8, 2021 · 2 comments · Fixed by #19457
Closed

[value-ptr-lite] Package config naming differs from package name #19448

redpandamonium opened this issue Aug 8, 2021 · 2 comments · Fixed by #19457
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@redpandamonium
Copy link

Describe the bug
When installing the value-ptr-lite package vcpkg suggests the following usage:

find_package(value-ptr-lite CONFIG REQUIRED)
target_link_libraries(main PRIVATE nonstd::value_ptr-lite)

This results in CMake not being able to find the config, because of a naming conflict. The config is found at vcpkg_installed/<arch-os>/share/value-ptr-lite/value_ptr-lite-config.cmake which conflicts with the name of its parent directory (which has the package name). So whichever version you use in find_package, it will not be found.

Could not find a package configuration file provided by "value-ptr-lite"
  with any of the following names:

    value-ptr-liteConfig.cmake
    value-ptr-lite-config.cmake
Could not find a package configuration file provided by "value_ptr-lite"
  with any of the following names:

    value_ptr-liteConfig.cmake
    value_ptr-lite-config.cmake

Environment

  • OS: MacOS 11.5
  • Compiler: Apple Clang 12.0.5

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install value-ptr-lite
  2. Use find_package(value-ptr-lite CONFIG REQUIRED)

Expected behavior
There are two possible expected behaviours. The first one is to adjust the usage suggestion. This works, because this is a header-only library.

find_path(VALUE_PTR_LITE_INCLUDE_DIRS "nonstd/value_ptr.hpp")
target_include_directories(main PRIVATE ${VALUE_PTR_LITE_INCLUDE_DIRS})

Alternatively if the naming conflict between the package name (value-ptr-lite) and the cmake config name (value_ptr-lite-config.cmake) is fixed and the config is found, the original suggestion is true. The config does define the target from the usage suggestion.

Failure logs
none

Additional context
none

@NancyLi1013 NancyLi1013 added the category:port-bug The issue is with a library, which is something the port should already support label Aug 9, 2021
@NancyLi1013
Copy link
Contributor

Hi @redpandamonium

Thanks for posting this issue. I have submitted a PR #19457 to fix this issue. It should be fine.

@redpandamonium
Copy link
Author

Thanks! Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants