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