-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
vcpkg install: Usage hint for CMake find_package, incomplete support for possible paths #10881
Comments
probably a bug in the usage printing which does not correctly search for a |
should be a vcpkg bug. |
Seeing this with the mdns library too.
|
This belongs to the #20190 gallery... |
cc @Cheney-W |
With microsoft/vcpkg-tool#849, vcpkg-tool will print usage heuristics only for config located directly in -mdns provides CMake targets:
-
- # this is heuristically generated, and may not be correct
- find_package(cmake CONFIG REQUIRED)
- target_link_libraries(main PRIVATE mdns::mdns)
+mdns is header-only and can be used from CMake via:
+
+ find_path(MDNS_INCLUDE_DIRS "mdns.h")
+ target_include_directories(main PRIVATE ${MDNS_INCLUDE_DIRS}) This is not plainly wrong as with the current tool, but still not what is desired. |
Duplicate of #20190 |
Describe the bug
Vcpkg does not provide the right usage hint for
<pkg_name>Config.cmake
files installed into a path ending incmake
.E.g.
/share/Microsoft.GSL/cmake/Microsoft.GSLConfig.cmake
, used in Microsoft/GSL/CMakeLists.txt.Without the work-around added in the portfile for #10831
vcpkg install ms-gsl
returns the following usage hint:Note the
cmake
infind_package
, this should beMicrosoft.GSL
.The current implementation shows a package name taken from the wrong folder.
Proposed solution
An update of the algorithm used to determine the package name.
There might be more valid paths that are not matched. (See the table below.)
Describe alternatives you've considered
Fixes, such as added to #10831, moving the files to a recognised path, are easy to forget and hard to maintain.
And they should not be necessary for projects using a valid path.
Additional context
Source: CMake documentation -
find_package
Search ProcedureThe text was updated successfully, but these errors were encountered: