-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add cmake package targets #6840
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
Conversation
966e4f3
to
dfc4d4b
Compare
Any progress on this PR? This's really helpful to someone who wants to get libgit2 easily used in a CMake based project. |
The task is ready, but needs to be accepted |
src/cli/CMakeLists.txt
Outdated
@@ -53,4 +53,4 @@ if(MSVC_IDE) | |||
set_source_files_properties(win32/precompiled.c COMPILE_FLAGS "/Ycprecompiled.h") | |||
endif() | |||
|
|||
install(TARGETS git2_cli RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | |||
install(TARGETS git2_cli EXPORT ${LIBGIT2_TARGETS_EXPORT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why we'd export the CLI targets? How would somebody make use of this and why would they want it? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, for the git cli, the export is unnecessary.
Thanks for your patience. Every time I look at cmake, my eyes glaze over, and I need to go lie down. Just one question to start with about the CLI. |
Thanks for the fix! This will land in v1.9. |
These changes will let the user call the command
find_package(libgit2)
when the library is installed, this can be use as aguarantee that the package is properly installed.