Skip to content

[dlib] Fix dependencies#50984

Merged
vicroms merged 1 commit intomicrosoft:masterfrom
dg0yt:dlib
Apr 6, 2026
Merged

[dlib] Fix dependencies#50984
vicroms merged 1 commit intomicrosoft:masterfrom
dg0yt:dlib

Conversation

@dg0yt
Copy link
Copy Markdown
Contributor

@dg0yt dg0yt commented Apr 6, 2026

Comment on lines -66 to +74
@@ -31,6 +31,14 @@ if(NOT TARGET dlib-shared AND NOT dlib_BINARY_DIR)
unset(dlib_deps_threads_check)
endif()
@@ -12,6 +12,18 @@
Copy link
Copy Markdown
Contributor Author

@dg0yt dg0yt Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Key change: Call find_dependency() early.

@Neumann-A
Copy link
Copy Markdown
Contributor

Put find_dependency before actual imported targets.

My last information was that CMake does not care about order as long as the target exists at the end of of configure (and there is no if(TARGET) check observing the target early).

@vicroms vicroms merged commit 07295d9 into microsoft:master Apr 6, 2026
16 checks passed
@dg0yt
Copy link
Copy Markdown
Contributor Author

dg0yt commented Apr 8, 2026

My last information was that CMake does not care about order as long as the target exists at the end of of configure (and there is no if(TARGET) check observing the target early).

It is right that typical errors are thrown only in the generation step, after the configuration step.

OTOH proper operation of config mode with imported targets and useful diagnostics relies on find_dependency being early in the config file. Get the config file right before tracing errors because this is something which can be done.

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 this pull request may close these issues.

[dlib] dlibConfig.cmake fails with "LAPACK::LAPACK target not found" — find_dependency calls placed after targets include

3 participants