1From 7cf6c014a36f1712efbdbe9bc52d2d4922b54673 Mon Sep 17 00:00:00 2001
2From: tamasmeszaros <meszaros.q@gmail.com>
3Date: Wed, 30 Oct 2019 12:54:52 +0100
4Subject: [PATCH] Blosc 1.17 fixes and cmake config script
5
6Signed-off-by: tamasmeszaros <meszaros.q@gmail.com>
7---
8 CMakeLists.txt                   | 105 +++++++++++++++++-----------------
9 blosc/CMakeLists.txt             | 118 +++++++++------------------------------
10 cmake/FindLZ4.cmake              |   6 +-
11 cmake/FindSnappy.cmake           |   8 ++-
12 cmake/FindZstd.cmake             |   8 ++-
13 cmake_config.cmake.in            |  24 ++++++++
14 internal-complibs/CMakeLists.txt |  35 ++++++++++++
15 7 files changed, 157 insertions(+), 147 deletions(-)
16 create mode 100644 cmake_config.cmake.in
17 create mode 100644 internal-complibs/CMakeLists.txt
18
19diff --git a/CMakeLists.txt b/CMakeLists.txt
20index 59d9fab..e9134c2 100644
21--- a/CMakeLists.txt
22+++ b/CMakeLists.txt
23@@ -71,7 +71,7 @@
24 #    DEV: static includes blosc.a and blosc.h
25
26
27-cmake_minimum_required(VERSION 2.8.12)
28+cmake_minimum_required(VERSION 3.1) # Threads::Threads target available from 3.1
29 if (NOT CMAKE_VERSION VERSION_LESS 3.3)
30     cmake_policy(SET CMP0063 NEW)
31 endif()
32@@ -124,55 +124,30 @@ option(PREFER_EXTERNAL_ZSTD
33
34 set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
35
36-
37-if(NOT DEACTIVATE_LZ4)
38-    if(PREFER_EXTERNAL_LZ4)
39-        find_package(LZ4)
40-    else()
41-        message(STATUS "Using LZ4 internal sources.")
42-    endif(PREFER_EXTERNAL_LZ4)
43-    # HAVE_LZ4 will be set to true because even if the library is
44-    # not found, we will use the included sources for it
45-    set(HAVE_LZ4 TRUE)
46-endif(NOT DEACTIVATE_LZ4)
47-
48-if(NOT DEACTIVATE_SNAPPY)
49-    if(PREFER_EXTERNAL_SNAPPY)
50-        find_package(Snappy)
51-    else()
52-        message(STATUS "Using Snappy internal sources.")
53-    endif(PREFER_EXTERNAL_SNAPPY)
54-    # HAVE_SNAPPY will be set to true because even if the library is not found,
55-    # we will use the included sources for it
56-    set(HAVE_SNAPPY TRUE)
57-endif(NOT DEACTIVATE_SNAPPY)
58-
59-if(NOT DEACTIVATE_ZLIB)
60-    # import the ZLIB_ROOT environment variable to help finding the zlib library
61-    if(PREFER_EXTERNAL_ZLIB)
62-        set(ZLIB_ROOT $ENV{ZLIB_ROOT})
63-        find_package(ZLIB)
64-        if (NOT ZLIB_FOUND )
65-            message(STATUS "No zlib found.  Using internal sources.")
66-        endif (NOT ZLIB_FOUND )
67-    else()
68-        message(STATUS "Using zlib internal sources.")
69-    endif(PREFER_EXTERNAL_ZLIB)
70-    # HAVE_ZLIB will be set to true because even if the library is not found,
71-    # we will use the included sources for it
72-    set(HAVE_ZLIB TRUE)
73-endif(NOT DEACTIVATE_ZLIB)
74-
75-if (NOT DEACTIVATE_ZSTD)
76-    if (PREFER_EXTERNAL_ZSTD)
77-        find_package(Zstd)
78-    else ()
79-        message(STATUS "Using ZSTD internal sources.")
80-    endif (PREFER_EXTERNAL_ZSTD)
81-    # HAVE_ZSTD will be set to true because even if the library is
82-    # not found, we will use the included sources for it
83-    set(HAVE_ZSTD TRUE)
84-endif (NOT DEACTIVATE_ZSTD)
85+set(LIBS "")
86+macro(use_package _pkg _tgt)
87+    string(TOUPPER ${_pkg} _PKG)
88+    if(NOT DEACTIVATE_${_PKG})
89+        if(PREFER_EXTERNAL_${_PKG})
90+            find_package(${_pkg})
91+            if (NOT ${_pkg}_FOUND )
92+                message(STATUS "No ${_pkg} found.  Using internal sources.")
93+            endif()
94+        else()
95+            message(STATUS "Using ${_pkg} internal sources.")
96+        endif(PREFER_EXTERNAL_${_PKG})
97+        # HAVE_${_pkg} will be set to true because even if the library is
98+        # not found, we will use the included sources for it
99+        set(HAVE_${_PKG} TRUE)
100+        list(APPEND LIBS ${_pkg}::${_tgt})
101+    endif(NOT DEACTIVATE_${_PKG})
102+endmacro()
103+
104+set(ZLIB_ROOT $ENV{ZLIB_ROOT})
105+use_package(ZLIB ZLIB)
106+use_package(LZ4 LZ4)
107+use_package(Snappy snappy)
108+use_package(Zstd Zstd)
109
110 # create the config.h file
111 configure_file ("blosc/config.h.in"  "blosc/config.h" )
112@@ -316,6 +291,7 @@ endif()
113
114
115 # subdirectories
116+add_subdirectory(internal-complibs)
117 add_subdirectory(blosc)
118
119 if(BUILD_TESTS)
120@@ -328,7 +304,6 @@ if(BUILD_BENCHMARKS)
121     add_subdirectory(bench)
122 endif(BUILD_BENCHMARKS)
123
124-
125 # uninstall target
126 if (BLOSC_INSTALL)
127     configure_file(
128@@ -338,10 +313,38 @@ if (BLOSC_INSTALL)
129     install(FILES "${CMAKE_CURRENT_BINARY_DIR}/blosc.pc"
130             DESTINATION lib/pkgconfig COMPONENT DEV)
131
132+    configure_file(
133+        "${CMAKE_CURRENT_SOURCE_DIR}/cmake_config.cmake.in"
134+        "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscConfig.cmake"
135+        @ONLY)
136+
137     configure_file(
138         "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
139         "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
140         IMMEDIATE @ONLY)
141+
142+    include(CMakePackageConfigHelpers)
143+    write_basic_package_version_file(
144+        "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscConfigVersion.cmake"
145+        VERSION ${BLOSC_VERSION_MAJOR}.${BLOSC_VERSION_MINOR}.${BLOSC_VERSION_PATCH}
146+        COMPATIBILITY AnyNewerVersion
147+    )
148+
149+    export(EXPORT BloscTargets
150+       FILE "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscTargets.cmake"
151+       NAMESPACE Blosc::)
152+
153+    install(EXPORT BloscTargets
154+            FILE BloscTargets.cmake
155+            NAMESPACE Blosc::
156+            DESTINATION lib/cmake/Blosc
157+            EXPORT_LINK_INTERFACE_LIBRARIES)
158+
159+    install(FILES
160+                "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscConfig.cmake"
161+                "${CMAKE_CURRENT_BINARY_DIR}/cmakeexports/BloscConfigVersion.cmake"
162+            DESTINATION lib/cmake/Blosc COMPONENT DEV)
163+
164     add_custom_target(uninstall
165         COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
166 endif()
167diff --git a/blosc/CMakeLists.txt b/blosc/CMakeLists.txt
168index 1d1bebe..f554abe 100644
169--- a/blosc/CMakeLists.txt
170+++ b/blosc/CMakeLists.txt
171@@ -1,52 +1,11 @@
172 # a simple way to detect that we are using CMAKE
173 add_definitions(-DUSING_CMAKE)
174
175-set(INTERNAL_LIBS ${PROJECT_SOURCE_DIR}/internal-complibs)
176-
177 # Hide symbols by default unless they're specifically exported.
178 # This makes it easier to keep the set of exported symbols the
179 # same across all compilers/platforms.
180 set(CMAKE_C_VISIBILITY_PRESET hidden)
181
182-# includes
183-set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
184-if(NOT DEACTIVATE_LZ4)
185-    if (LZ4_FOUND)
186-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_INCLUDE_DIR})
187-    else(LZ4_FOUND)
188-        set(LZ4_LOCAL_DIR ${INTERNAL_LIBS}/lz4-1.9.1)
189-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${LZ4_LOCAL_DIR})
190-    endif(LZ4_FOUND)
191-endif(NOT DEACTIVATE_LZ4)
192-
193-if(NOT DEACTIVATE_SNAPPY)
194-    if (SNAPPY_FOUND)
195-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${SNAPPY_INCLUDE_DIR})
196-    else(SNAPPY_FOUND)
197-        set(SNAPPY_LOCAL_DIR ${INTERNAL_LIBS}/snappy-1.1.1)
198-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${SNAPPY_LOCAL_DIR})
199-    endif(SNAPPY_FOUND)
200-endif(NOT DEACTIVATE_SNAPPY)
201-
202-if(NOT DEACTIVATE_ZLIB)
203-    if (ZLIB_FOUND)
204-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR})
205-    else(ZLIB_FOUND)
206-        set(ZLIB_LOCAL_DIR ${INTERNAL_LIBS}/zlib-1.2.8)
207-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZLIB_LOCAL_DIR})
208-    endif(ZLIB_FOUND)
209-endif(NOT DEACTIVATE_ZLIB)
210-
211-if (NOT DEACTIVATE_ZSTD)
212-    if (ZSTD_FOUND)
213-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_INCLUDE_DIR})
214-    else (ZSTD_FOUND)
215-        set(ZSTD_LOCAL_DIR ${INTERNAL_LIBS}/zstd-1.4.1)
216-        set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIRS} ${ZSTD_LOCAL_DIR} ${ZSTD_LOCAL_DIR}/common)
217-    endif (ZSTD_FOUND)
218-endif (NOT DEACTIVATE_ZSTD)
219-
220-include_directories(${BLOSC_INCLUDE_DIRS})
221
222 # library sources
223 set(SOURCES blosc.c blosclz.c fastcopy.c shuffle-generic.c bitshuffle-generic.c
224@@ -73,53 +32,13 @@ if(WIN32)
225         message(STATUS "using the internal pthread library for win32 systems.")
226         set(SOURCES ${SOURCES} win32/pthread.c)
227     else(NOT Threads_FOUND)
228-        set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
229+        list(APPEND LIBS Threads::Threads)
230     endif(NOT Threads_FOUND)
231 else(WIN32)
232     find_package(Threads REQUIRED)
233-    set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
234+    list(APPEND LIBS Threads::Threads)
235 endif(WIN32)
236
237-if(NOT DEACTIVATE_LZ4)
238-    if(LZ4_FOUND)
239-        set(LIBS ${LIBS} ${LZ4_LIBRARY})
240-    else(LZ4_FOUND)
241-        file(GLOB LZ4_FILES ${LZ4_LOCAL_DIR}/*.c)
242-        set(SOURCES ${SOURCES} ${LZ4_FILES})
243-    endif(LZ4_FOUND)
244-endif(NOT DEACTIVATE_LZ4)
245-
246-if(NOT DEACTIVATE_SNAPPY)
247-    if(SNAPPY_FOUND)
248-        set(LIBS ${LIBS} ${SNAPPY_LIBRARY})
249-    else(SNAPPY_FOUND)
250-        file(GLOB SNAPPY_FILES ${SNAPPY_LOCAL_DIR}/*.cc)
251-        set(SOURCES ${SOURCES} ${SNAPPY_FILES})
252-    endif(SNAPPY_FOUND)
253-endif(NOT DEACTIVATE_SNAPPY)
254-
255-if(NOT DEACTIVATE_ZLIB)
256-    if(ZLIB_FOUND)
257-        set(LIBS ${LIBS} ${ZLIB_LIBRARY})
258-    else(ZLIB_FOUND)
259-        file(GLOB ZLIB_FILES ${ZLIB_LOCAL_DIR}/*.c)
260-        set(SOURCES ${SOURCES} ${ZLIB_FILES})
261-    endif(ZLIB_FOUND)
262-endif(NOT DEACTIVATE_ZLIB)
263-
264-if (NOT DEACTIVATE_ZSTD)
265-    if (ZSTD_FOUND)
266-        set(LIBS ${LIBS} ${ZSTD_LIBRARY})
267-    else (ZSTD_FOUND)
268-      file(GLOB ZSTD_FILES
269-        ${ZSTD_LOCAL_DIR}/common/*.c
270-        ${ZSTD_LOCAL_DIR}/compress/*.c
271-        ${ZSTD_LOCAL_DIR}/decompress/*.c)
272-        set(SOURCES ${SOURCES} ${ZSTD_FILES})
273-    endif (ZSTD_FOUND)
274-endif (NOT DEACTIVATE_ZSTD)
275-
276-
277 # targets
278 if (BUILD_SHARED)
279     add_library(blosc_shared SHARED ${SOURCES})
280@@ -191,14 +110,17 @@ if (BUILD_TESTS)
281     endif()
282 endif()
283
284+add_library(blosc INTERFACE)
285+
286 if (BUILD_SHARED)
287-    target_link_libraries(blosc_shared ${LIBS})
288-    target_include_directories(blosc_shared PUBLIC ${BLOSC_INCLUDE_DIRS})
289+    target_link_libraries(blosc_shared PRIVATE ${LIBS})
290+    target_include_directories(blosc_shared PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
291+    target_link_libraries(blosc INTERFACE blosc_shared)
292 endif()
293
294 if (BUILD_TESTS)
295-    target_link_libraries(blosc_shared_testing ${LIBS})
296-    target_include_directories(blosc_shared_testing PUBLIC ${BLOSC_INCLUDE_DIRS})
297+    target_link_libraries(blosc_shared_testing PRIVATE ${LIBS})
298+    target_include_directories(blosc_shared_testing PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
299 endif()
300
301 if(BUILD_STATIC)
302@@ -207,17 +129,31 @@ if(BUILD_STATIC)
303     if (MSVC)
304         set_target_properties(blosc_static PROPERTIES PREFIX lib)
305     endif()
306-    target_link_libraries(blosc_static ${LIBS})
307-    target_include_directories(blosc_static PUBLIC ${BLOSC_INCLUDE_DIRS})
308+    # With the static library, cmake has to deal with transitive dependencies
309+    target_link_libraries(blosc_static PRIVATE ${LIBS})
310+    target_include_directories(blosc_static PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
311+    if (NOT BUILD_SHARED)
312+        target_link_libraries(blosc INTERFACE blosc_static)
313+    endif()
314 endif(BUILD_STATIC)
315
316+
317 # install
318 if(BLOSC_INSTALL)
319     install(FILES blosc.h blosc-export.h DESTINATION include COMPONENT DEV)
320+    set(_inst_libs "blosc")
321     if(BUILD_SHARED)
322-        install(TARGETS blosc_shared DESTINATION ${lib_dir} COMPONENT LIB)
323+        list(APPEND _inst_libs blosc_shared)
324     endif(BUILD_SHARED)
325     if(BUILD_STATIC)
326-        install(TARGETS blosc_static DESTINATION ${lib_dir} COMPONENT DEV)
327+        list(APPEND _inst_libs blosc_static)
328     endif(BUILD_STATIC)
329+
330+    install(TARGETS ${_inst_libs}
331+            EXPORT BloscTargets
332+            LIBRARY DESTINATION ${lib_dir}
333+            ARCHIVE DESTINATION ${lib_dir}
334+            RUNTIME DESTINATION bin
335+            COMPONENT DEV
336+            INCLUDES DESTINATION include)
337 endif(BLOSC_INSTALL)
338diff --git a/cmake/FindLZ4.cmake b/cmake/FindLZ4.cmake
339index e581a80..05de6ef 100644
340--- a/cmake/FindLZ4.cmake
341+++ b/cmake/FindLZ4.cmake
342@@ -5,6 +5,10 @@ find_library(LZ4_LIBRARY NAMES lz4)
343 if (LZ4_INCLUDE_DIR AND LZ4_LIBRARY)
344     set(LZ4_FOUND TRUE)
345     message(STATUS "Found LZ4 library: ${LZ4_LIBRARY}")
346+    add_library(LZ4::LZ4 UNKNOWN IMPORTED)
347+    set_target_properties(LZ4::LZ4 PROPERTIES
348+        IMPORTED_LOCATION ${LZ4_LIBRARY}
349+        INTERFACE_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR})
350 else ()
351     message(STATUS "No LZ4 library found.  Using internal sources.")
352-endif ()
353+endif ()
354\ No newline at end of file
355diff --git a/cmake/FindSnappy.cmake b/cmake/FindSnappy.cmake
356index 688d4d5..21dbee1 100644
357--- a/cmake/FindSnappy.cmake
358+++ b/cmake/FindSnappy.cmake
359@@ -3,8 +3,12 @@ find_path(SNAPPY_INCLUDE_DIR snappy-c.h)
360 find_library(SNAPPY_LIBRARY NAMES snappy)
361
362 if (SNAPPY_INCLUDE_DIR AND SNAPPY_LIBRARY)
363-    set(SNAPPY_FOUND TRUE)
364+    set(Snappy_FOUND TRUE)
365+    add_library(Snappy::snappy UNKNOWN IMPORTED)
366+    set_target_properties(Snappy::snappy PROPERTIES
367+        IMPORTED_LOCATION ${SNAPPY_LIBRARY}
368+        INTERFACE_INCLUDE_DIRECTORIES ${SNAPPY_INCLUDE_DIR})
369     message(STATUS "Found SNAPPY library: ${SNAPPY_LIBRARY}")
370 else ()
371     message(STATUS "No snappy found.  Using internal sources.")
372-endif ()
373+endif ()
374\ No newline at end of file
375diff --git a/cmake/FindZstd.cmake b/cmake/FindZstd.cmake
376index 7db4bb9..cabc2f8 100644
377--- a/cmake/FindZstd.cmake
378+++ b/cmake/FindZstd.cmake
379@@ -3,8 +3,12 @@ find_path(ZSTD_INCLUDE_DIR zstd.h)
380 find_library(ZSTD_LIBRARY NAMES zstd)
381
382 if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY)
383-    set(ZSTD_FOUND TRUE)
384+    set(Zstd_FOUND TRUE)
385+    add_library(Zstd::Zstd UNKNOWN IMPORTED)
386+    set_target_properties(Zstd::Zstd PROPERTIES
387+        IMPORTED_LOCATION ${ZSTD_LIBRARY}
388+        INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR})
389     message(STATUS "Found Zstd library: ${ZSTD_LIBRARY}")
390 else ()
391     message(STATUS "No Zstd library found.  Using internal sources.")
392-endif ()
393+endif ()
394\ No newline at end of file
395diff --git a/cmake_config.cmake.in b/cmake_config.cmake.in
396new file mode 100644
397index 0000000..0f6af24
398--- /dev/null
399+++ b/cmake_config.cmake.in
400@@ -0,0 +1,24 @@
401+include(CMakeFindDependencyMacro)
402+
403+include("${CMAKE_CURRENT_LIST_DIR}/BloscTargets.cmake")
404+
405+function(_blosc_remap_configs from_Cfg to_Cfg)
406+    string(TOUPPER ${from_Cfg} from_CFG)
407+    string(TOLOWER ${from_Cfg} from_cfg)
408+
409+    if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/BloscTargets-${from_cfg}.cmake)
410+        foreach(tgt IN ITEMS blosc_static blosc_shared blosc)
411+            if(TARGET Blosc::${tgt})
412+                set_target_properties(Blosc::${tgt} PROPERTIES
413+                    MAP_IMPORTED_CONFIG_${from_CFG} ${to_Cfg})
414+            endif()
415+        endforeach()
416+    endif()
417+endfunction()
418+
419+# MSVC will try to link RelWithDebInfo or MinSizeRel target with debug config
420+# if no matching installation is present which would result in link errors.
421+if(MSVC)
422+    _blosc_remap_configs(RelWithDebInfo Release)
423+    _blosc_remap_configs(MinSizeRel Release)
424+endif()
425diff --git a/internal-complibs/CMakeLists.txt b/internal-complibs/CMakeLists.txt
426new file mode 100644
427index 0000000..4586efa
428--- /dev/null
429+++ b/internal-complibs/CMakeLists.txt
430@@ -0,0 +1,35 @@
431+macro(add_lib_target pkg tgt incdir files)
432+    string(TOUPPER ${pkg} TGT)
433+    if(NOT DEACTIVATE_${TGT} AND NOT ${pkg}_FOUND)
434+        add_library(${tgt}_objs OBJECT ${files})
435+        add_library(${tgt} INTERFACE)
436+        target_include_directories(${tgt}_objs PRIVATE $<BUILD_INTERFACE:${incdir}>)
437+        target_include_directories(${tgt} INTERFACE $<BUILD_INTERFACE:${incdir}>)
438+        #set_target_properties(${tgt} PROPERTIES INTERFACE_SOURCES "$<TARGET_OBJECTS:${tgt}_objs>")
439+        set_target_properties(${tgt}_objs PROPERTIES POSITION_INDEPENDENT_CODE ON)
440+        target_sources(${tgt} INTERFACE "$<BUILD_INTERFACE:$<TARGET_OBJECTS:${tgt}_objs>>")
441+        add_library(${pkg}::${tgt} ALIAS ${tgt})
442+
443+        # This creates dummy (empty) interface targets in the exported config.
444+        install(TARGETS ${tgt} EXPORT BloscTargets INCLUDES DESTINATION include)
445+    endif()
446+    unset(TGT)
447+endmacro()
448+
449+set(ZLIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib-1.2.8)
450+file(GLOB ZLIB_FILES ${ZLIB_DIR}/*.c)
451+add_lib_target(ZLIB ZLIB ${ZLIB_DIR} "${ZLIB_FILES}")
452+
453+set(SNAPPY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/snappy-1.1.1)
454+file(GLOB SNAPPY_FILES ${SNAPPY_DIR}/*.cc)
455+add_lib_target(Snappy snappy ${SNAPPY_DIR} "${SNAPPY_FILES}")
456+
457+set(LZ4_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lz4-1.9.1)
458+file(GLOB LZ4_FILES ${LZ4_DIR}/*.c)
459+add_lib_target(LZ4 LZ4 ${LZ4_DIR} "${LZ4_FILES}")
460+
461+set(ZSTD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zstd-1.4.1)
462+file(GLOB ZSTD_FILES ${ZSTD_DIR}/common/*.c ${ZSTD_DIR}/compress/*.c ${ZSTD_DIR}/decompress/*.c)
463+add_lib_target(Zstd Zstd ${ZSTD_DIR} "${ZSTD_FILES}")
464+target_include_directories(Zstd INTERFACE $<BUILD_INTERFACE:${ZSTD_DIR}/common>)
465+target_include_directories(Zstd_objs PRIVATE $<BUILD_INTERFACE:${ZSTD_DIR}/common>)
466\ No newline at end of file
467--
4682.16.2.windows.1
469
470