1From 46a4e585175cac8d76bd0b64f0fc27c9e22f04a1 Mon Sep 17 00:00:00 2001
2From: Pascal Bach <pascal.bach@nextrem.ch>
3Date: Mon, 12 Oct 2020 21:22:46 +0200
4Subject: [PATCH] cmake: Use exported target for bz2
5
6Without this change, CMake puts the entire path into the generated file.
7This is not portable and makes it fail in environment like Yocto.
8
9Upstream-Status: Submitted [https://github.com/facebook/rocksdb/pull/7541]
10---
11 CMakeLists.txt | 9 ++-------
12 1 file changed, 2 insertions(+), 7 deletions(-)
13
14--- a/CMakeLists.txt
15+++ b/CMakeLists.txt
16@@ -32,7 +32,7 @@
17 # 3. cmake ..
18 # 4. make -j
19
20-cmake_minimum_required(VERSION 3.5.1)
21+cmake_minimum_required(VERSION 3.7.2)
22
23 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/")
24 include(ReadVersion)
25@@ -152,12 +152,7 @@ else()
26   if(WITH_BZ2)
27     find_package(BZip2 REQUIRED)
28     add_definitions(-DBZIP2)
29-    if(BZIP2_INCLUDE_DIRS)
30-      include_directories(${BZIP2_INCLUDE_DIRS})
31-    else()
32-      include_directories(${BZIP2_INCLUDE_DIR})
33-    endif()
34-    list(APPEND THIRDPARTY_LIBS ${BZIP2_LIBRARIES})
35+    list(APPEND THIRDPARTY_LIBS BZip2::BZip2)
36   endif()
37
38   if(WITH_LZ4)
39