[dlib] fix LAPACK::LAPACK target not found in dlibConfig.cmake#50979
Draft
Kicer86 wants to merge 1 commit intomicrosoft:masterfrom
Draft
[dlib] fix LAPACK::LAPACK target not found in dlibConfig.cmake#50979Kicer86 wants to merge 1 commit intomicrosoft:masterfrom
Kicer86 wants to merge 1 commit intomicrosoft:masterfrom
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree |
The fix-dependencies and fix-lapack patches insert find_dependency(BLAS) and find_dependency(LAPACK) after the include of the targets file (dlib.cmake) in dlibConfig.cmake. This causes CMake to fail because LAPACK::LAPACK and BLAS::BLAS are referenced at target load time before they are defined. Fix by post-install patching dlibConfig.cmake: move the dependency resolution before the targets include and add fallback target creation for BLAS::BLAS and LAPACK::LAPACK.
Contributor
|
Why is the LAPACK::LAPACK target not found? This looks more like an outdated module and this is not the correct fix. |
Contributor
|
IMO the actual problem is that find_dependency comes too late. Please test #50984. However I did a little bit more cleanup. |
dg0yt
reviewed
Apr 6, 2026
Comment on lines
+65
to
+70
| # Workaround: The fix-dependencies and fix-lapack patches insert find_dependency | ||
| # calls for BLAS/LAPACK AFTER the include of the targets file (dlib.cmake) in | ||
| # dlibConfig.cmake. CMake fails because LAPACK::LAPACK and BLAS::BLAS are | ||
| # referenced in dlib.cmake before they are defined. | ||
| # Fix: remove the misplaced calls and inject explicit find_package calls (which | ||
| # go through the vcpkg cmake wrappers) before the targets include block. |
Contributor
There was a problem hiding this comment.
FTR find_dependency() goes through find_package() goes through wrappers. There is no point in layering fragile fixup over poorly maintained patches when we can just fix the patches.
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#Fixes #50976
./vcpkg x-add-version --alland committing the result.