Warning, /utilities/ark/plugins/libarchive/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 include_directories(${LibArchive_INCLUDE_DIRS})
0002 
0003 ########### next target ###############
0004 
0005 # NOTE: These are the mimetypes for "single-file" archives. They must be defined in the JSON metadata together with the "normal" mimetypes.
0006 # However they need to be duplicated here because we need to pass them as C++ define to the plugin (see LIBARCHIVE_RAW_MIMETYPES define below).
0007 set(SUPPORTED_LIBARCHIVE_RAW_MIMETYPES "application/x-compress;application/gzip;application/x-bzip;application/x-bzip2;application/zlib;application/zstd;application/x-lzma;application/x-xz;application/x-lz4;application/x-lzip;application/x-lrzip;application/x-lzop;")
0008 
0009 set(INSTALLED_LIBARCHIVE_PLUGINS "")
0010 
0011 set(kerfuffle_libarchive_readonly_SRCS libarchiveplugin.cpp readonlylibarchiveplugin.cpp ark_debug.cpp)
0012 set(kerfuffle_libarchive_readwrite_SRCS libarchiveplugin.cpp readwritelibarchiveplugin.cpp ark_debug.cpp)
0013 set(kerfuffle_libarchive_SRCS ${kerfuffle_libarchive_readonly_SRCS} readwritelibarchiveplugin.cpp)
0014 
0015 ecm_qt_declare_logging_category(kerfuffle_libarchive_SRCS
0016                                 HEADER ark_debug.h
0017                                 IDENTIFIER ARK
0018                                 CATEGORY_NAME ark.libarchive DESCRIPTION "Ark Libarchive plugin" EXPORT ARK)
0019 
0020 configure_file(
0021     ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_libarchive_readonly.json.cmake
0022     ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_libarchive_readonly.json)
0023 
0024 configure_file(
0025     ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_libarchive.json.cmake
0026     ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_libarchive.json)
0027 
0028 kerfuffle_parse_json_mimetypes(${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_libarchive_readonly.json)
0029 set(SUPPORTED_LIBARCHIVE_MIMETYPES "${SUPPORTED_LIBARCHIVE_MIMETYPES}${PLUGIN_SUPPORTED_MIMETYPES}")
0030 
0031 kerfuffle_parse_json_mimetypes(${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_libarchive.json)
0032 set(SUPPORTED_LIBARCHIVE_MIMETYPES "${SUPPORTED_LIBARCHIVE_MIMETYPES}${PLUGIN_SUPPORTED_MIMETYPES}")
0033 
0034 set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_LIBARCHIVE_MIMETYPES}" PARENT_SCOPE)
0035 
0036 kerfuffle_add_plugin(kerfuffle_libarchive_readonly ${kerfuffle_libarchive_readonly_SRCS})
0037 kerfuffle_add_plugin(kerfuffle_libarchive ${kerfuffle_libarchive_readwrite_SRCS})
0038 
0039 # Concat the list of raw mimetypes in a single string, so that we can pass it as C++ define to the plugin.
0040 # NOTE: cannot use ";" as separator since it breaks cmake badly.
0041 list(JOIN SUPPORTED_LIBARCHIVE_RAW_MIMETYPES ":" RAW_MIMETYPES_CONCAT)
0042 target_compile_definitions(kerfuffle_libarchive_readonly PRIVATE -DLIBARCHIVE_RAW_MIMETYPES="${RAW_MIMETYPES_CONCAT}")
0043 
0044 target_link_libraries(kerfuffle_libarchive_readonly ${LibArchive_LIBRARIES})
0045 target_link_libraries(kerfuffle_libarchive ${LibArchive_LIBRARIES})
0046 
0047 set(INSTALLED_LIBARCHIVE_PLUGINS "${INSTALLED_LIBARCHIVE_PLUGINS}kerfuffle_libarchive_readonly;")
0048 set(INSTALLED_LIBARCHIVE_PLUGINS "${INSTALLED_LIBARCHIVE_PLUGINS}kerfuffle_libarchive;")
0049 
0050 set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}${INSTALLED_LIBARCHIVE_PLUGINS}" PARENT_SCOPE)
0051 
0052 find_program(LRZIP lrzip)
0053 if(LRZIP)
0054     message(STATUS "Found lrzip executable: ${LRZIP}")
0055 else()
0056     message(WARNING "Could not find the lrzip executable. Ark requires lrzip to handle the tar.lrz archive format.")
0057 endif()
0058 
0059 find_program(LZOP lzop)
0060 if(LZOP)
0061     message(STATUS "Found lzop executable: ${LZOP}")
0062 else()
0063     message(WARNING "Could not find the lzop executable. Ark requires lzop to handle the tar.lzo archive format if libarchive >= 3.3 has been compiled without liblzo2 support.")
0064 endif()
0065 
0066 find_program(ZSTD zstd)
0067 if(ZSTD)
0068     message(STATUS "Found zstd executable: ${ZSTD}")
0069 else()
0070     message(WARNING "Could not find the zstd executable. Ark requires zstd to handle the tar.zst archive format if libarchive >= 3.3.3 has been compiled without libzstd support.")
0071 endif()