Commit 722809e8 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Use imported targets for libzip and zlib

parent cb214389
......@@ -33,4 +33,12 @@ find_package_handle_standard_args(LibZip
REQUIRED_VARS LibZip_LIBRARIES LibZip_INCLUDE_DIR LibZip_INCLUDE_CONF_DIR
VERSION_VAR LibZip_VERSION)
if(LibZip_FOUND AND NOT TARGET LibZip::LibZip)
add_library(LibZip::LibZip UNKNOWN IMPORTED)
set_target_properties(LibZip::LibZip PROPERTIES
IMPORTED_LOCATION "${LibZip_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LibZip_INCLUDE_DIRS}"
)
endif()
mark_as_advanced(LibZip_INCLUDE_DIR LibZip_INCLUDE_CONF_DIR)
include(CheckSymbolExists)
include_directories(${LibZip_INCLUDE_DIRS})
set(SUPPORTED_LIBZIP_MIMETYPES "application/zip;")
set(INSTALLED_LIBZIP_PLUGINS "")
......@@ -35,7 +33,7 @@ configure_file(
kerfuffle_add_plugin(kerfuffle_libzip ${kerfuffle_libzip_SRCS})
target_link_libraries(kerfuffle_libzip KF5::KIOCore ${LibZip_LIBRARIES} ${ZLIB_LIBRARIES})
target_link_libraries(kerfuffle_libzip KF5::KIOCore LibZip::LibZip ZLIB::ZLIB)
set(INSTALLED_LIBZIP_PLUGINS "${INSTALLED_LIBZIP_PLUGINS}kerfuffle_libzip;")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment