aboutsummaryrefslogtreecommitdiff
path: root/ports/rocksdb/0003-use-find-package.patch
blob: e05de2a4bb3964110661468d74957a6051ab100b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6761929..6f74d31 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,7 +91,7 @@ include(CMakeDependentOption)
 CMAKE_DEPENDENT_OPTION(WITH_GFLAGS "build with GFlags" ON
   "NOT MSVC;NOT MINGW" OFF)
 
-if(MSVC)
+if(MSVC AND NOT VCPKG_TOOLCHAIN)
   option(WITH_XPRESS "build with windows built in compression" OFF)
   include(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty.inc)
 else()
@@ -130,10 +130,7 @@ else()
   endif()
 
   if(WITH_SNAPPY)
-    find_package(Snappy CONFIG)
-    if(NOT Snappy_FOUND)
-      find_package(Snappy REQUIRED)
-    endif()
+    find_package(Snappy CONFIG REQUIRED)
     add_definitions(-DSNAPPY)
     list(APPEND THIRDPARTY_LIBS Snappy::snappy)
   endif()
@@ -157,16 +154,19 @@ else()
   endif()
 
   if(WITH_LZ4)
-    find_package(lz4 REQUIRED)
+    find_package(lz4 CONFIG REQUIRED)
     add_definitions(-DLZ4)
     list(APPEND THIRDPARTY_LIBS lz4::lz4)
   endif()
 
   if(WITH_ZSTD)
-    find_package(zstd REQUIRED)
+    find_package(zstd CONFIG REQUIRED)
     add_definitions(-DZSTD)
-    include_directories(${ZSTD_INCLUDE_DIR})
-    list(APPEND THIRDPARTY_LIBS zstd::zstd)
+    if(TARGET zstd::libzstd_shared)
+    list(APPEND THIRDPARTY_LIBS zstd::libzstd_shared)
+    elseif(TARGET zstd::libzstd_static)
+    list(APPEND THIRDPARTY_LIBS zstd::libzstd_static)   
+    endif()
   endif()
 endif()
 
@@ -375,9 +375,9 @@ endif()
 
 option(WITH_TBB "build with Threading Building Blocks (TBB)" OFF)
 if(WITH_TBB)
-  find_package(TBB REQUIRED)
+  find_package(TBB CONFIG REQUIRED)
   add_definitions(-DTBB)
-  list(APPEND THIRDPARTY_LIBS TBB::TBB)
+  list(APPEND THIRDPARTY_LIBS TBB::tbb)
 endif()
 
 # Stall notifications eat some performance from inserts