1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index 6761929..6f74d31 100644
5 @@ -91,7 +91,7 @@ include(CMakeDependentOption)
6 CMAKE_DEPENDENT_OPTION(WITH_GFLAGS "build with GFlags" ON
7 "NOT MSVC;NOT MINGW" OFF)
10 +if(MSVC AND NOT VCPKG_TOOLCHAIN)
11 option(WITH_XPRESS "build with windows built in compression" OFF)
12 include(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty.inc)
14 @@ -130,10 +130,7 @@ else()
18 - find_package(Snappy CONFIG)
19 - if(NOT Snappy_FOUND)
20 - find_package(Snappy REQUIRED)
22 + find_package(Snappy CONFIG REQUIRED)
23 add_definitions(-DSNAPPY)
24 list(APPEND THIRDPARTY_LIBS Snappy::snappy)
26 @@ -157,16 +154,19 @@ else()
30 - find_package(lz4 REQUIRED)
31 + find_package(lz4 CONFIG REQUIRED)
32 add_definitions(-DLZ4)
33 list(APPEND THIRDPARTY_LIBS lz4::lz4)
37 - find_package(zstd REQUIRED)
38 + find_package(zstd CONFIG REQUIRED)
39 add_definitions(-DZSTD)
40 - include_directories(${ZSTD_INCLUDE_DIR})
41 - list(APPEND THIRDPARTY_LIBS zstd::zstd)
42 + if(TARGET zstd::libzstd_shared)
43 + list(APPEND THIRDPARTY_LIBS zstd::libzstd_shared)
44 + elseif(TARGET zstd::libzstd_static)
45 + list(APPEND THIRDPARTY_LIBS zstd::libzstd_static)
50 @@ -375,9 +375,9 @@ endif()
52 option(WITH_TBB "build with Threading Building Blocks (TBB)" OFF)
54 - find_package(TBB REQUIRED)
55 + find_package(TBB CONFIG REQUIRED)
56 add_definitions(-DTBB)
57 - list(APPEND THIRDPARTY_LIBS TBB::TBB)
58 + list(APPEND THIRDPARTY_LIBS TBB::tbb)
61 # Stall notifications eat some performance from inserts