-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
What's the meaning of add_library (*** ALIAS ***) #70
Comments
It provides an alternative way to reference a target name in other parts of your cmake files. In that example you have
One good use case that I have found for this is in the
and some some reason the
And you didn't have a |
Here is a link to the cmake documentation on alias targets https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#alias-targets |
@ttroy50 I don't believe this is a valid use case for this feature... The accidental linking can directly be avoided using the original target_link_libraries(hello_binary
PRIVATE
hello_library::hello_library
) If the target isn't found, this would fail (which is what we want) instead of looking for a library in the filesystem. |
add_library(hello::library ALIAS hello_library)
why must to use alias name for hello_library? Can I not use the alias name?
The text was updated successfully, but these errors were encountered: