Update archiving libs and their linking

This commit is contained in:
Georg Hagen
2024-05-26 23:06:17 +02:00
parent 7fa25267d5
commit 70cd46544b
5 changed files with 255 additions and 10 deletions

View File

@@ -29,3 +29,13 @@ execute_process(
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}/deps/INSTALL)
endif()
function(LinkLibArchive TARGET)
find_package(LibArchive REQUIRED)
set(ZLIB_USE_STATIC_LIBS ON)
find_package(ZLIB REQUIRED)
find_package(LZ4 REQUIRED)
find_package(zstd REQUIRED)
target_include_directories(${TARGET} PRIVATE ${LibArchive_INCLUDE_DIR})
target_link_libraries(${TARGET} PRIVATE ${LibArchive_LIBRARIES} ${ZLIB_LIBRARIES} ${zstd_LIBRARIES} ${LZ4_LIBRARIES})
endfunction()