You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/03/20 02:10:18 UTC
[arrow] branch master updated: ARROW-4950: [C++] Fix CMake 3.2 build
This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new b378a4d ARROW-4950: [C++] Fix CMake 3.2 build
b378a4d is described below
commit b378a4d1c365ecac5163ddad64c41f8dd3bcf150
Author: Korn, Uwe <Uw...@blue-yonder.com>
AuthorDate: Tue Mar 19 21:08:53 2019 -0500
ARROW-4950: [C++] Fix CMake 3.2 build
Author: Korn, Uwe <Uw...@blue-yonder.com>
Closes #3979 from xhochy/ARROW-4950 and squashes the following commits:
5f0df5a66 <Korn, Uwe> ARROW-4950: Fix CMake 3.2 build
---
ci/conda_env_cpp.yml | 2 +-
cpp/cmake_modules/FindBrotli.cmake | 3 ++-
cpp/cmake_modules/FindLz4.cmake | 4 +++-
cpp/cmake_modules/FindThrift.cmake | 3 ++-
cpp/cmake_modules/ThirdpartyToolchain.cmake | 18 ++++++++++++++++++
5 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/ci/conda_env_cpp.yml b/ci/conda_env_cpp.yml
index 92ff616..4863267 100644
--- a/ci/conda_env_cpp.yml
+++ b/ci/conda_env_cpp.yml
@@ -20,7 +20,7 @@ boost-cpp>=1.68.0
brotli
bzip2
c-ares
-cmake>=3.12
+cmake
double-conversion
flatbuffers
gflags
diff --git a/cpp/cmake_modules/FindBrotli.cmake b/cpp/cmake_modules/FindBrotli.cmake
index 632a28c..e1429a2 100644
--- a/cpp/cmake_modules/FindBrotli.cmake
+++ b/cpp/cmake_modules/FindBrotli.cmake
@@ -106,7 +106,8 @@ find_package_handle_standard_args(Brotli
BROTLI_DEC_LIBRARY
BROTLI_INCLUDE_DIR)
-if(Brotli_FOUND)
+if(Brotli_FOUND OR BROTLI_FOUND)
+ set(Brotli_FOUND TRUE)
add_library(Brotli::brotlicommon UNKNOWN IMPORTED)
set_target_properties(Brotli::brotlicommon
PROPERTIES IMPORTED_LOCATION "${BROTLI_COMMON_LIBRARY}"
diff --git a/cpp/cmake_modules/FindLz4.cmake b/cpp/cmake_modules/FindLz4.cmake
index 747d68a..3606f5c 100644
--- a/cpp/cmake_modules/FindLz4.cmake
+++ b/cpp/cmake_modules/FindLz4.cmake
@@ -56,7 +56,9 @@ endif()
find_package_handle_standard_args(Lz4 REQUIRED_VARS LZ4_LIB LZ4_INCLUDE_DIR)
-if(Lz4_FOUND)
+# CMake 3.2 does uppercase the FOUND variable
+if(Lz4_FOUND OR LZ4_FOUND)
+ set(Lz4_FOUND TRUE)
add_library(LZ4::lz4 UNKNOWN IMPORTED)
set_target_properties(LZ4::lz4
PROPERTIES IMPORTED_LOCATION "${LZ4_LIB}"
diff --git a/cpp/cmake_modules/FindThrift.cmake b/cpp/cmake_modules/FindThrift.cmake
index 991f024..a4decf7 100644
--- a/cpp/cmake_modules/FindThrift.cmake
+++ b/cpp/cmake_modules/FindThrift.cmake
@@ -97,7 +97,8 @@ find_package_handle_standard_args(Thrift
THRIFT_INCLUDE_DIR
THRIFT_COMPILER)
-if(Thrift_FOUND)
+if(Thrift_FOUND OR THRIFT_FOUND)
+ set(Thrift_FOUND TRUE)
add_library(Thrift::thrift STATIC IMPORTED)
set_target_properties(Thrift::thrift
PROPERTIES IMPORTED_LOCATION "${THRIFT_STATIC_LIB}"
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index a392484..29b6173 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -2002,6 +2002,24 @@ macro(build_grpc)
endmacro()
if(ARROW_WITH_GRPC)
+ # gRPC requires OpenSSL but it depends on OpenSSL::SSL and OpenSSL::Crypto
+ # which are not available in older CMake versions.
+ find_package(OpenSSL REQUIRED)
+ if(NOT TARGET OpenSSL::SSL)
+ add_library(OpenSSL::SSL UNKNOWN IMPORTED)
+ set_target_properties(OpenSSL::SSL
+ PROPERTIES IMPORTED_LOCATION "${OPENSSL_SSL_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES
+ "${OPENSSL_INCLUDE_DIR}")
+ endif()
+ if(NOT TARGET OpenSSL::Crypto)
+ add_library(OpenSSL::Crypto UNKNOWN IMPORTED)
+ set_target_properties(OpenSSL::Crypto
+ PROPERTIES IMPORTED_LOCATION "${OPENSSL_CRYPTO_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES
+ "${OPENSSL_INCLUDE_DIR}")
+ endif()
+
get_dependency_source(gRPC)
if(gRPC_SOURCE STREQUAL "AUTO")
find_package(gRPC QUIET)