-
Notifications
You must be signed in to change notification settings - Fork 189
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
if CPM_LOCAL_PACKAGES_ONLY, make find_package
fail if it failed to find.
#589
base: master
Are you sure you want to change the base?
Conversation
It seems like you called I'm not a fan of forcing
I think this behavior comes down to personal preference. I prefer CPM to download all dependencies while I make ☕, regardless of whether an error occurs. Lines 719 to 734 in 011d3dd
If a local package isn't found and CPM falls back to FetchContent , we still print a warning. However, since this fallback is intentional and part of CPM's functionality, the warning might confuse users.
I`m not a maintainer, just interested in helping out wherever I can. |
I've called
I thought that adding the keyword is logically correct ( with that PR ) :
How it is now:
FYI :
That's why
In such case, use not
Yep, I agree that the warning is now still not good enough. I will add right now to the warning message something like "The warning emitted bacause CPM_USE_LOCAL_PACKAGES is set to ${CPM_USE_LOCAL_PACKAGES} . Falling back to downloading the package." |
Also thanks for reminding about |
I've found that if using CPM_LOCAL_PACKAGES_ONLY , it will make
message(SEND_ERROR ...)
about failure.https://cmake.org/cmake/help/latest/command/message.html
message(SEND_ERROR ...)
not fails immediately, which makes CPM go further and download the package, though not allowing to generatefind_package
.Firstly I thought to change
message(SEND_ERROR ...
tomessage(FATAL_ERROR ...)
But my real problem was that
find_package
have found a package with specified version, but not some of its components.IDK how to get error message from
find_package
, that's why I've made that if CPM_LOCAL_PACKAGES_ONLY to just askfind_package
to fail if it failed, and show its error logs by itself. And that's just by addingREQUIRED
.