Open tusharb86 opened 2 years ago
VCPKG_OVERRIDE_FIND_PACKAGE_NAME
is broken. Don't use it. Without cmake_language(CALL)
the correct behavior was never implementable.
If you have problems with find_package being overriden by you somehow. Look at #23195
Thanks for the details @Neumann-A! It would be great to get that PR through. The workaround I used in my case was to add the following macro:
macro(_find_package)
find_package(${ARGV})
endmacro()
This allows VCPKG_OVERRIDE_FIND_PACKAGE_NAME
to work.
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.
still relevant
relevant
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.
still relevant
Describe the bug I am using
'VCPKG_OVERRIDE_FIND_PACKAGE_NAME
to override the name of find_package to effectively change it tofind_vcpkg_package
for use in our project. In doing so, I have found that the scripts in vcpkg have made an assumption that find_package has been overloaded and that_find_package
is to be called. (See lines 792, 796, 798, etc. in vcpkg.cmake, for example). Unfortunately, this leads to errors like this:In this specific case, the issue is in the vcpkg-cmake-wrapper.cmake script where it is assuming that
_find_package
exists.Environment
To Reproduce Set
VCPKG_OVERRIDE_FIND_PACKAGE_NAME
as you normally would on the command line for CMake to something likefind_vcpkg_package
. Somewhere in your project, add a call tofind_vcpkg_package
for any library of your choosing.Expected behavior I would expect that
VCPKG_OVERRIDE_FIND_PACKAGE_NAME
is honored everywhere. If it is defined, thenfind_package
must be called. If it is NOT defined, then_find_package
can be called.