Skip to content
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

fixed: No libarchiveConfig.cmake file after build and install with th… #1912

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TumiWang
Copy link

@TumiWang TumiWang commented Jul 1, 2023

using cmake to build and install, No libarchiveConfig.cmake file is in prefix directory.
Fixed: libarchiveConfig.cmake Will be in ${PREFIX}/share/cmake/Libarchive/ directory

@kientzle
Copy link
Contributor

kientzle commented Jul 1, 2023

@bradking - does this look reasonable to you? I'm not that familiar with CMake installation conventions.

@bradking
Copy link
Contributor

bradking commented Jul 5, 2023

It would be nice for upstream libarchive to provide a proper CMake Package Configuration file. However, projects can only rely on it if all libarchive installations reliably provide it. The change proposed here will provide it only for distributions that use CMake to build libarchive itself. Those using the autotools build system for libarchive will not provide it.

Since CMake already comes with builtin support for find_package(LibArchive), I don't think we should provide an upstream version of the package for CMake unless it is always available. It is possible to provide a hand-written LibArchiveConfig.cmake file from the autotools build system that matches the same set of target names provided by the CMake-generated one. I'd prefer to see that added to this PR before we move forward.

@@ -264,6 +264,8 @@ IF(ENABLE_INSTALL)
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
INSTALL(TARGETS archive archive_static
EXPORT libarchive_target)
Copy link
Contributor

Choose a reason for hiding this comment

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

CMake already comes with a builtin FindLibArchive module that is used to implement find_package(LibArchive) calls. If upstream libarchive does start providing a CMake package, it should provide the same LibArchive::LibArchive target name that the find module does to help projects transition. Some internal refactoring of libarchive's CMake build system may be helpful to match target names.

Copy link
Contributor

@kientzle kientzle left a comment

Choose a reason for hiding this comment

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

Please address Brad King's feedback.

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.

None yet

3 participants