libzippp
libzippp copied to clipboard
Could NOT find LIBZIP (missing: _libzip_pkgcfg)
Error:
CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find LIBZIP (missing: _libzip_pkgcfg)
Call Stack (most recent call first):
/usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/FindLIBZIP.cmake:17 (find_package_handle_standard_args)
CMakeLists.txt:20 (find_package)
libzip-1.7.3
provides its own cmake files that should be used. I solved this with this patch:
+++ CMakeLists.txt
@@ -17,7 +17,7 @@ option(LIBZIPPP_ENABLE_ENCRYPTION "Build with encrypti
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
-find_package(LIBZIP MODULE REQUIRED)
+find_package(libzip REQUIRED)
add_library(libzippp "src/libzippp.cpp")
add_library(libzippp::libzippp ALIAS libzippp) # Convenience alias
@@ -87,10 +87,10 @@ if(LIBZIPPP_INSTALL)
COMPATIBILITY SameMajorVersion
)
- install(
- FILES ${PROJECT_CONFIG_FILE} ${PROJECT_VERSION_FILE} cmake/FindLIBZIP.cmake
- DESTINATION ${configInstallDestination}
- )
+ #install(
+ # FILES ${PROJECT_CONFIG_FILE} ${PROJECT_VERSION_FILE} cmake/FindLIBZIP.cmake
+ # DESTINATION ${configInstallDestination}
+ #)
install(
EXPORT libzipppTargets
OS: FreeBSD 13
Hi @yurivict
Thanks for the report.
Could you please tell if it is the commenting of the install section that did the trick or the find_package
related change ?
Does it work if you use find_package(libzip MODULE REQUIRED)
? Looks like a case issue :thinking:
find_package(libzip MODULE REQUIRED)
looks for Findlibzip.cmake and fails.
Both parts are needed.
But then, how can find_package(libzip REQUIRED)
work ? It should also look for Findlibzip.cmake
:thinking:
I guess the install fails for the same reason, because of the path to the cmake...
But then, how can find_package(libzip REQUIRED) work ? It should also look for Findlibzip.cmake
No, it looks for standard cmake files that are installed by libzip and finds them,
Findzip.cmake is only needed when the project doesn't provide cmake files.
I found the same question, but I use a manually way:
#find_package(LIBZIP MODULE REQUIRED)
include_directories("C:/Program Files/libzip/include")
link_directories("C:/Program Files/libzip/lib")\n
and
#target_link_libraries(libzippp PRIVATE libzip::zip)
target_link_libraries(libzippp PRIVATE zip)
,
it works.
Since I could not reproduce the issue, I'm closing it. Please, submit a PR if possible. Thanks.