2023-12-24 13:14:51 +01:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
|
|
|
include(ImHexPlugin)
|
|
|
|
|
2023-12-31 11:39:24 +01:00
|
|
|
macro(addOptionalLibrary package library)
|
|
|
|
find_package(${package})
|
|
|
|
if (${package}_FOUND)
|
|
|
|
string(TOUPPER ${package} PACKAGE)
|
|
|
|
set(LIBRARIES ${LIBRARIES} ${package}::${library})
|
|
|
|
message(STATUS "Enabling decompression support using ${package} (${${package}_VERSION})")
|
|
|
|
enable_plugin_feature(${PACKAGE})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
endmacro()
|
2023-12-24 13:14:51 +01:00
|
|
|
|
|
|
|
add_imhex_plugin(
|
|
|
|
NAME
|
|
|
|
decompress
|
|
|
|
SOURCES
|
|
|
|
source/plugin_decompress.cpp
|
|
|
|
|
|
|
|
source/content/pl_functions.cpp
|
|
|
|
INCLUDES
|
|
|
|
include
|
|
|
|
LIBRARIES
|
|
|
|
ui
|
2024-01-28 22:14:59 +01:00
|
|
|
fonts
|
2023-12-31 11:39:24 +01:00
|
|
|
FEATURES
|
2024-07-08 18:12:46 +02:00
|
|
|
ZLIB "ZLib support"
|
|
|
|
BZIP2 "Bzip2 support"
|
|
|
|
LIBLZMA "LZMA support"
|
|
|
|
ZSTD "zstd Support"
|
|
|
|
LZ4 "lz4 Support"
|
2023-12-24 13:14:51 +01:00
|
|
|
)
|
2023-12-31 11:39:24 +01:00
|
|
|
|
2024-07-07 10:26:24 +02:00
|
|
|
set(LIBLZMA_HAS_AUTO_DECODER 1)
|
|
|
|
set(LIBLZMA_HAS_EASY_ENCODER 1)
|
|
|
|
set(LIBLZMA_HAS_LZMA_PRESET 1)
|
2023-12-31 11:39:24 +01:00
|
|
|
|
|
|
|
addOptionalLibrary(ZLIB ZLIB)
|
|
|
|
addOptionalLibrary(BZip2 BZip2)
|
|
|
|
addOptionalLibrary(LibLZMA LibLZMA)
|
2024-07-07 10:26:24 +02:00
|
|
|
addOptionalLibrary(ZSTD zstd)
|
|
|
|
addOptionalLibrary(LZ4 lz4)
|
2023-12-31 11:39:24 +01:00
|
|
|
target_link_libraries(decompress PRIVATE ${LIBRARIES})
|