add cmake lz4 support

add some instructions for build/cmake/README.md
This commit is contained in:
l00292966
2019-06-03 18:22:50 +08:00
committed by l00292966
parent b13a9207f9
commit b31df043a0
3 changed files with 104 additions and 0 deletions
+16
View File
@@ -83,7 +83,9 @@ endif ()
option(ZSTD_ZLIB_SUPPORT "ZLIB SUPPORT" OFF)
option(ZSTD_LZMA_SUPPORT "LZMA SUPPORT" OFF)
option(ZSTD_LZ4_SUPPORT "LZ4 SUPPORT" OFF)
# Add gzip support
if (ZSTD_ZLIB_SUPPORT)
find_package(ZLIB REQUIRED)
@@ -96,6 +98,7 @@ if (ZSTD_ZLIB_SUPPORT)
endif ()
endif ()
# Add lzma support
if (ZSTD_LZMA_SUPPORT)
find_package(LibLZMA REQUIRED)
@@ -107,3 +110,16 @@ if (ZSTD_LZMA_SUPPORT)
message(SEND_ERROR "lzma library is missing")
endif ()
endif ()
# Add lz4 support
if (ZSTD_LZ4_SUPPORT)
find_package(LibLZ4 REQUIRED)
if (LIBLZ4_FOUND)
include_directories(${LIBLZ4_INCLUDE_DIRS})
target_link_libraries(zstd ${LIBLZ4_LIBRARIES})
set_property(TARGET zstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_LZ4COMPRESS;ZSTD_LZ4DECOMPRESS")
else ()
message(SEND_ERROR "lz4 library is missing")
endif ()
endif ()