You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ph...@apache.org on 2018/07/24 12:58:25 UTC

nifi-minifi-cpp git commit: MINIFICPP-561 Added internal/static build of bzip2

Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 9ca6b4c24 -> b57af84d6


MINIFICPP-561 Added internal/static build of bzip2

This closes #375.

Signed-off-by: Marc Parisi <ph...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/b57af84d
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/b57af84d
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/b57af84d

Branch: refs/heads/master
Commit: b57af84d612a14d183469204a274a2f4dbaaa8fb
Parents: 9ca6b4c
Author: Andrew I. Christianson <an...@andyic.org>
Authored: Wed Jul 18 11:23:58 2018 -0400
Committer: Marc Parisi <ph...@apache.org>
Committed: Tue Jul 24 08:58:10 2018 -0400

----------------------------------------------------------------------
 CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b57af84d/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 023aed6..1177813 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@ option(USE_SYSTEM_OPENSSL "Instructs the build system to search for and use an S
 option(USE_SYSTEM_UUID "Instructs the build system to search for and use an UUID library available in the host system" ON)
 option(USE_SYSTEM_CURL "Instructs the build system to search for and use a cURL library available in the host system" ON)
 option(USE_SYSTEM_ZLIB "Instructs the build system to search for and use a zlib library available in the host system" ON)
+option(USE_SYSTEM_BZIP2 "Instructs the build system to search for and use a bzip2 library available in the host system" ON)
 option(BUILD_ROCKSDB "Instructs the build system to use RocksDB from the third party directory" ON)
 
 include(FeatureSummary)
@@ -169,6 +170,37 @@ if (ZLIB_FOUND)
   include_directories(${ZLIB_INCLUDE_DIRS})
 endif()
 
+if(NOT USE_SYSTEM_BZIP2)
+  message("Using bundled bzip2")
+
+  ExternalProject_Add(
+    bzip2-external
+    URL http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
+    URL_MD5 00b516f4704d4a7cb50a1d97e6e8e15b
+    SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/bzip2-src"
+    CONFIGURE_COMMAND ""
+    BUILD_COMMAND make libbz2.a CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
+    BUILD_IN_SOURCE 1
+    BUILD_BYPRODUCTS "thirdparty/bzip2-src/libbz2.a"
+    INSTALL_COMMAND ""
+  )
+
+  list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/bzip2/dummy")
+  add_library(bz2 STATIC IMPORTED)
+  set_target_properties(bz2 PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/bzip2-src/libbz2.a")
+  add_dependencies(bz2 bzip2-external)
+  set(BZIP2_FOUND "YES")
+  set(BZIP2_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/thirdparty/bzip2-src")
+  set(BZIP2_LIBRARY bz2)
+  set(BZIP2_LIBRARIES ${BZIP2_LIBRARY})
+else()
+  find_package (BZip2 REQUIRED)
+endif()
+
+if (BZIP2_FOUND)
+  include_directories(${BZIP2_INCLUDE_DIRS})
+endif()
+
 SET(TEST_DIR ${CMAKE_SOURCE_DIR}/libminifi/test)
 
 include(Extensions)