From 2011b8512b1c16fc1f8cf07689591854d531abee Mon Sep 17 00:00:00 2001 From: Phil Felton <39185762+philjdf@users.noreply.github.com> Date: Wed, 16 Jan 2019 18:29:07 +0000 Subject: [PATCH] [Arrow] Update Arrow to 0.11.1 (#4977) * Arrow update * Add version info * Forgot to apply patch * Whitespace * Fix patch * Fix patch * Version which works on Linux * Fix problem finding ZSTD on x64-windows * Fix zlib dependency finding * Fix renaming on Windows * Include missing boost-format dependency * Linux debug build picks up debug libs now * Make windows work again * Remove boost-format dependency * Error if dependencies not found rather than attempt to download them * [parquet] Turn parquest into a stub --- ports/arrow/CONTROL | 4 +- ports/arrow/all.patch | 1339 ++++++++++++++++++++++++++++++++-- ports/arrow/portfile.cmake | 36 +- ports/parquet/CONTROL | 6 +- ports/parquet/all.patch | 779 -------------------- ports/parquet/portfile.cmake | 53 +- 6 files changed, 1305 insertions(+), 912 deletions(-) delete mode 100644 ports/parquet/all.patch diff --git a/ports/arrow/CONTROL b/ports/arrow/CONTROL index dd7bea53c07..cedc63bf4ea 100644 --- a/ports/arrow/CONTROL +++ b/ports/arrow/CONTROL @@ -1,4 +1,4 @@ Source: arrow -Version: 0.9.0-1 -Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, zstd, snappy, gflags +Version: 0.11.1 +Build-Depends: boost-system, boost-filesystem, boost-multiprecision, boost-algorithm, flatbuffers, rapidjson, zlib, lz4, brotli, zstd, snappy, gflags, thrift, double-conversion, glog Description: Apache Arrow is a columnar in-memory analytics layer designed to accelerate big data. It houses a set of canonical in-memory representations of flat and hierarchical data along with multiple language-bindings for structure manipulation. It also provides IPC and common algorithm implementations. diff --git a/ports/arrow/all.patch b/ports/arrow/all.patch index bb67ec13ffd..31be15f5b2c 100644 --- a/ports/arrow/all.patch +++ b/ports/arrow/all.patch @@ -1,28 +1,57 @@ -diff --git a/cpp/cmake_modules/FindBrotli.cmake b/cpp/cmake_modules/FindBrotli.cmake -index ea971f0..3e98ede 100644 ---- a/cpp/cmake_modules/FindBrotli.cmake -+++ b/cpp/cmake_modules/FindBrotli.cmake -@@ -43,53 +43,31 @@ find_path( BROTLI_INCLUDE_DIR NAMES brotli/decode.h - NO_DEFAULT_PATH +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4448b98..d6aa484 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -743,10 +743,10 @@ elseif (PTHREAD_LIBRARY) + # linking order. + set(ARROW_LINK_LIBS + ${ARROW_LINK_LIBS} +- ${PTHREAD_LIBRARY}) ++ pthreadshared) + set(ARROW_STATIC_LINK_LIBS + ${ARROW_STATIC_LINK_LIBS} +- ${PTHREAD_LIBRARY}) ++ pthreadshared) + endif() + + ############################################################ +@@ -780,3 +780,4 @@ endif() + if(ARROW_GANDIVA) + add_subdirectory(src/gandiva) + endif() ++ +diff --git a/cmake_modules/FindBrotli.cmake b/cmake_modules/FindBrotli.cmake +index ea971f0..e8dfb3c 100644 +--- a/cmake_modules/FindBrotli.cmake ++++ b/cmake_modules/FindBrotli.cmake +@@ -39,57 +39,27 @@ elseif ( Brotli_HOME ) + endif() + + find_path( BROTLI_INCLUDE_DIR NAMES brotli/decode.h +- PATHS ${_brotli_roots} +- NO_DEFAULT_PATH PATH_SUFFIXES "include" ) -find_library( BROTLI_LIBRARY_ENC NAMES libbrotlienc.a libbrotlienc-static.a brotlienc +- PATHS ${_brotli_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ) +find_library( BROTLI_LIBRARY_ENC NAMES libbrotlienc libbrotlienc-static brotlienc brotlienc-static - PATHS ${_brotli_roots} - NO_DEFAULT_PATH - PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ) ++ PATH_SUFFIXES "lib" ) -find_library( BROTLI_LIBRARY_DEC NAMES libbrotlidec.a libbrotlidec-static.a brotlidec +- PATHS ${_brotli_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ) +find_library( BROTLI_LIBRARY_DEC NAMES libbrotlidec libbrotlidec-static brotlidec brotlidec-static - PATHS ${_brotli_roots} - NO_DEFAULT_PATH - PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ) ++ PATH_SUFFIXES "lib" ) -find_library( BROTLI_LIBRARY_COMMON NAMES libbrotlicommon.a libbrotlicommon-static.a brotlicommon +- PATHS ${_brotli_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ) +find_library( BROTLI_LIBRARY_COMMON NAMES libbrotlicommon libbrotlicommon-static brotlicommon brotlicommon-static - PATHS ${_brotli_roots} - NO_DEFAULT_PATH - PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ) ++ PATH_SUFFIXES "lib" ) set(BROTLI_LIBRARIES ${BROTLI_LIBRARY_ENC} ${BROTLI_LIBRARY_DEC} ${BROTLI_LIBRARY_COMMON}) @@ -65,30 +94,103 @@ index ea971f0..3e98ede 100644 else () set(BROTLI_FOUND FALSE) endif () -diff --git a/cpp/cmake_modules/FindFlatbuffers.cmake b/cpp/cmake_modules/FindFlatbuffers.cmake -index 804f479..baac84e 100644 ---- a/cpp/cmake_modules/FindFlatbuffers.cmake -+++ b/cpp/cmake_modules/FindFlatbuffers.cmake -@@ -53,6 +53,7 @@ endif () +diff --git a/cmake_modules/FindFlatbuffers.cmake b/cmake_modules/FindFlatbuffers.cmake +index 975c869..9cee8a0 100644 +--- a/cmake_modules/FindFlatbuffers.cmake ++++ b/cmake_modules/FindFlatbuffers.cmake +@@ -31,31 +31,26 @@ + # FLATBUFFERS_STATIC_LIB, path to libflatbuffers.a + # FLATBUFFERS_FOUND, whether flatbuffers has been found + +-if( NOT "${FLATBUFFERS_HOME}" STREQUAL "") +- file( TO_CMAKE_PATH "${FLATBUFFERS_HOME}" _native_path ) +- list( APPEND _flatbuffers_roots "${_native_path}" ) +-elseif ( Flatbuffers_HOME ) +- list( APPEND _flatbuffers_roots "${Flatbuffers_HOME}" ) ++if(WIN32) ++ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(FLATBUFFERS_LIB_SUFFIX mdd) ++ else() ++ set(FLATBUFFERS_LIB_SUFFIX md) ++ endif() ++else() ++ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(FLATBUFFERS_LIB_SUFFIX "d") ++ else() ++ set(FLATBUFFERS_LIB_SUFFIX "") ++ endif() + endif() + +-# Try the parameterized roots, if they exist +-if ( _flatbuffers_roots ) +- find_path( FLATBUFFERS_INCLUDE_DIR NAMES flatbuffers/flatbuffers.h +- PATHS "${_flatbuffers_roots}" NO_DEFAULT_PATH +- PATH_SUFFIXES "include" ) +- find_library( FLATBUFFERS_LIBRARIES NAMES flatbuffers +- PATHS "${_flatbuffers_roots}" NO_DEFAULT_PATH +- PATH_SUFFIXES "lib" "lib64") +-else () +- find_path( FLATBUFFERS_INCLUDE_DIR NAMES flatbuffers/flatbuffers.h ) +- find_library( FLATBUFFERS_LIBRARIES NAMES flatbuffers ) +-endif () ++find_path( FLATBUFFERS_INCLUDE_DIR NAMES flatbuffers/flatbuffers.h ) ++find_library( FLATBUFFERS_LIBRARIES NAMES flatbuffers ) find_program(FLATBUFFERS_COMPILER flatc - "${FLATBUFFERS_HOME}/bin" +- "${FLATBUFFERS_HOME}/bin" +- /usr/local/bin +- /usr/bin +- NO_DEFAULT_PATH ++ PATH_SUFFIXES + "${FLATBUFFERS_HOME}/tools/flatbuffers" - /usr/local/bin - /usr/bin - NO_DEFAULT_PATH -diff --git a/cpp/cmake_modules/FindLz4.cmake b/cpp/cmake_modules/FindLz4.cmake -index 3a89c8d..3157197 100644 ---- a/cpp/cmake_modules/FindLz4.cmake -+++ b/cpp/cmake_modules/FindLz4.cmake -@@ -29,21 +29,11 @@ elseif ( Lz4_HOME ) + ) + + if (FLATBUFFERS_INCLUDE_DIR AND FLATBUFFERS_LIBRARIES) +diff --git a/cmake_modules/FindGLOG.cmake b/cmake_modules/FindGLOG.cmake +index f22e4df..53e545b 100644 +--- a/cmake_modules/FindGLOG.cmake ++++ b/cmake_modules/FindGLOG.cmake +@@ -29,11 +29,6 @@ + # GLOG_STATIC_LIB, path to libglog.a + # GLOG_FOUND, whether glog has been found + +-if( NOT "${GLOG_HOME}" STREQUAL "") +- file( TO_CMAKE_PATH "${GLOG_HOME}" _native_path ) +- list( APPEND _glog_roots ${_native_path} ) +-endif() +- + message(STATUS "GLOG_HOME: ${GLOG_HOME}") + # Try the parameterized roots, if they exist + if ( _glog_roots ) +@@ -43,10 +38,10 @@ if ( _glog_roots ) + endif () + + find_path( GLOG_INCLUDE_DIR NAMES glog/logging.h +- PATHS ${_glog_roots} NO_DEFAULT_PATH ++ PATHS ${_glog_roots} + PATH_SUFFIXES "include" ) + find_library( GLOG_LIBRARIES NAMES glog +- PATHS ${_glog_roots} NO_DEFAULT_PATH ++ PATHS ${_glog_roots} + PATH_SUFFIXES ${lib_dirs}) + else () + find_path( GLOG_INCLUDE_DIR NAMES glog/logging.h ) +diff --git a/cmake_modules/FindLz4.cmake b/cmake_modules/FindLz4.cmake +index 3a89c8d..1e068b4 100644 +--- a/cmake_modules/FindLz4.cmake ++++ b/cmake_modules/FindLz4.cmake +@@ -29,23 +29,16 @@ elseif ( Lz4_HOME ) list( APPEND _lz4_roots ${Lz4_HOME} ) endif() -if (MSVC AND NOT DEFINED LZ4_MSVC_STATIC_LIB_SUFFIX) - set(LZ4_MSVC_STATIC_LIB_SUFFIX "_static") --endif() -- ++if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(LZ4_LIB_NAME lz4d) ++else() ++ set(LZ4_LIB_NAME lz4) + endif() + -set(LZ4_STATIC_LIB_SUFFIX - "${LZ4_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") - @@ -96,52 +198,1153 @@ index 3a89c8d..3157197 100644 - ${CMAKE_STATIC_LIBRARY_PREFIX}lz4${LZ4_STATIC_LIB_SUFFIX}) - find_path(LZ4_INCLUDE_DIR NAMES lz4.h - PATHS ${_lz4_roots} - NO_DEFAULT_PATH +- PATHS ${_lz4_roots} +- NO_DEFAULT_PATH PATH_SUFFIXES "include" ) -find_library(LZ4_STATIC_LIB NAMES ${LZ4_STATIC_LIB_NAME} lib${LZ4_STATIC_LIB_NAME} -+find_library(LZ4_STATIC_LIB NAMES lz4 liblz4 - PATHS ${_lz4_roots} - NO_DEFAULT_PATH +- PATHS ${_lz4_roots} +- NO_DEFAULT_PATH ++ ++find_library(LZ4_STATIC_LIB NAMES ${LZ4_LIB_NAME} PATH_SUFFIXES "lib" ) -diff --git a/cpp/cmake_modules/FindSnappy.cmake b/cpp/cmake_modules/FindSnappy.cmake -index 867963c..8a432db 100644 ---- a/cpp/cmake_modules/FindSnappy.cmake -+++ b/cpp/cmake_modules/FindSnappy.cmake -@@ -55,7 +55,7 @@ if (SNAPPY_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR SNAPPY_LIBRARIES)) + + include(FindPackageHandleStandardArgs) +diff --git a/cmake_modules/FindSnappy.cmake b/cmake_modules/FindSnappy.cmake +index 867963c..fd45321 100644 +--- a/cmake_modules/FindSnappy.cmake ++++ b/cmake_modules/FindSnappy.cmake +@@ -31,31 +31,23 @@ + # SNAPPY_SHARED_LIB, path to libsnappy's shared library + # SNAPPY_FOUND, whether snappy has been found + +-if( NOT "${SNAPPY_HOME}" STREQUAL "") +- file( TO_CMAKE_PATH "${SNAPPY_HOME}" _native_path ) +- list( APPEND _snappy_roots ${_native_path} ) +-elseif ( Snappy_HOME ) +- list( APPEND _snappy_roots ${Snappy_HOME} ) +-endif() +- +-message(STATUS "SNAPPY_HOME: ${SNAPPY_HOME}") +-find_path(SNAPPY_INCLUDE_DIR snappy.h HINTS +- ${_snappy_roots} +- NO_DEFAULT_PATH ++find_path(SNAPPY_INCLUDE_DIR snappy.h + PATH_SUFFIXES "include") + +-find_library( SNAPPY_LIBRARIES NAMES snappy PATHS +- ${_snappy_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "lib") ++if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(SNAPPY_LIB_NAME snappyd) ++else() ++ set(SNAPPY_LIB_NAME snappy) ++endif() ++ ++find_library( SNAPPY_LIBRARIES NAMES ${SNAPPY_LIB_NAME} PATH_SUFFIXES "lib") + + if (SNAPPY_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR SNAPPY_LIBRARIES)) + set(SNAPPY_FOUND TRUE) + get_filename_component( SNAPPY_LIBS ${SNAPPY_LIBRARIES} PATH ) set(SNAPPY_HEADER_NAME snappy.h) set(SNAPPY_HEADER ${SNAPPY_INCLUDE_DIR}/${SNAPPY_HEADER_NAME}) - set(SNAPPY_LIB_NAME snappy) +- set(SNAPPY_LIB_NAME snappy) - set(SNAPPY_STATIC_LIB ${SNAPPY_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${SNAPPY_LIB_NAME}${SNAPPY_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(SNAPPY_STATIC_LIB ${SNAPPY_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${SNAPPY_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) set(SNAPPY_SHARED_LIB ${SNAPPY_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${SNAPPY_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) else () set(SNAPPY_FOUND FALSE) -diff --git a/cpp/cmake_modules/FindZLIB.cmake b/cpp/cmake_modules/FindZLIB.cmake -index 78b84f2..56cc887 100644 ---- a/cpp/cmake_modules/FindZLIB.cmake -+++ b/cpp/cmake_modules/FindZLIB.cmake -@@ -61,9 +61,7 @@ if (ZLIB_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR ZLIB_LIBRARIES)) - set(ZLIB_HEADER ${ZLIB_INCLUDE_DIR}/${ZLIB_HEADER_NAME}) - set(ZLIB_LIB_NAME z) - if (MSVC) -- if (NOT ZLIB_MSVC_STATIC_LIB_SUFFIX) -- set(ZLIB_MSVC_STATIC_LIB_SUFFIX libstatic) -- endif() -+ set(ZLIB_MSVC_STATIC_LIB_SUFFIX lib) - set(ZLIB_MSVC_SHARED_LIB_SUFFIX lib) - endif() - set(ZLIB_STATIC_LIB ${ZLIB_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${ZLIB_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -diff --git a/cpp/cmake_modules/FindZSTD.cmake b/cpp/cmake_modules/FindZSTD.cmake -index 810e5c0..b483471 100644 ---- a/cpp/cmake_modules/FindZSTD.cmake -+++ b/cpp/cmake_modules/FindZSTD.cmake -@@ -43,7 +43,7 @@ find_path(ZSTD_INCLUDE_DIR NAMES zstd.h - PATHS ${_zstd_roots} - NO_DEFAULT_PATH - PATH_SUFFIXES "include" ) +diff --git a/cmake_modules/FindThrift.cmake b/cmake_modules/FindThrift.cmake +index 5402766..6cff9fa 100644 +--- a/cmake_modules/FindThrift.cmake ++++ b/cmake_modules/FindThrift.cmake +@@ -28,41 +28,31 @@ + # THRIFT_STATIC_LIB, THRIFT static library + # THRIFT_FOUND, If false, do not try to use ant + +-# prefer the thrift version supplied in THRIFT_HOME +-if( NOT "${THRIFT_HOME}" STREQUAL "") +- file( TO_CMAKE_PATH "${THRIFT_HOME}" _native_path ) +- list( APPEND _thrift_roots ${_native_path} ) +-elseif ( Thrift_HOME ) +- list( APPEND _thrift_roots ${Thrift_HOME} ) +-endif() +- +-message(STATUS "THRIFT_HOME: ${THRIFT_HOME}") +-find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h HINTS +- ${_thrift_roots} +- NO_DEFAULT_PATH ++find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h + PATH_SUFFIXES "include" + ) + +-find_path(THRIFT_CONTRIB_DIR share/fb303/if/fb303.thrift HINTS +- ${_thrift_roots} +- NO_DEFAULT_PATH +-) +- +-if (MSVC AND NOT THRIFT_MSVC_STATIC_LIB_SUFFIX) +- set(THRIFT_MSVC_STATIC_LIB_SUFFIX md) ++if(WIN32) ++ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(THRIFT_LIB_SUFFIX mdd) ++ else() ++ set(THRIFT_LIB_SUFFIX md) ++ endif() ++else() ++ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(THRIFT_LIB_SUFFIX "d") ++ else() ++ set(THRIFT_LIB_SUFFIX "") ++ endif() + endif() + + find_library(THRIFT_STATIC_LIB NAMES +- ${CMAKE_STATIC_LIBRARY_PREFIX}thrift${THRIFT_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} +- HINTS ${_thrift_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ++ thrift${THRIFT_LIB_SUFFIX} ++ PATH_SUFFIXES lib + ) + + find_program(THRIFT_COMPILER thrift HINTS +- ${_thrift_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "bin" ++ PATH_SUFFIXES "tools" + ) + + function(EXTRACT_THRIFT_VERSION) +@@ -111,7 +101,6 @@ else () + endif () + endif () + +- + mark_as_advanced( + THRIFT_STATIC_LIB + THRIFT_COMPILER +diff --git a/cmake_modules/FindZLIB.cmake b/cmake_modules/FindZLIB.cmake +index ca6060b..85a4585 100644 +--- a/cmake_modules/FindZLIB.cmake ++++ b/cmake_modules/FindZLIB.cmake +@@ -30,43 +30,15 @@ + # ZLIB_SHARED_LIB, path to libz's shared library + # ZLIB_FOUND, whether zlib has been found + +-if( NOT "${ZLIB_HOME}" STREQUAL "") +- file( TO_CMAKE_PATH "${ZLIB_HOME}" _native_path ) +- list( APPEND _zlib_roots ${_native_path} ) +-elseif ( ZLIB_HOME ) +- list( APPEND _zlib_roots ${ZLIB_HOME} ) ++if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(ZLIB_LIB_NAME_SUFFIX "d") ++else() ++ set(ZLIB_LIB_NAME_SUFFIX "") + endif() + +-if (MSVC) +- # zlib uses zlib.lib for Windows. +- set(ZLIB_LIB_NAME zlib.lib) +-else () +- # zlib uses libz.so for non Windows. +- set(ZLIB_LIB_NAME +- ${CMAKE_SHARED_LIBRARY_PREFIX}z${CMAKE_SHARED_LIBRARY_SUFFIX}) +-endif () +- + # Try the parameterized roots, if they exist +-if (_zlib_roots) +- find_path(ZLIB_INCLUDE_DIR NAMES zlib.h +- PATHS ${_zlib_roots} NO_DEFAULT_PATH +- PATH_SUFFIXES "include") +- find_library(ZLIB_SHARED_LIB +- NAMES ${ZLIB_LIB_NAME} +- PATHS ${_zlib_roots} NO_DEFAULT_PATH +- PATH_SUFFIXES "lib") +-else () +- pkg_check_modules(PKG_ZLIB zlib) +- if (PKG_ZLIB_FOUND) +- set(ZLIB_INCLUDE_DIR ${PKG_ZLIB_INCLUDEDIR}) +- find_library(ZLIB_SHARED_LIB +- NAMES ${ZLIB_LIB_NAME} +- PATHS ${PKG_ZLIB_LIBDIR} NO_DEFAULT_PATH) +- else () +- find_path(ZLIB_INCLUDE_DIR NAMES zlib.h) +- find_library(ZLIB_SHARED_LIB NAMES ${ZLIB_LIB_NAME}) +- endif () +-endif () ++find_path(ZLIB_INCLUDE_DIR NAMES zlib.h PATH_SUFFIXES "include") ++find_library(ZLIB_SHARED_LIB NAMES z zlib${ZLIB_LIB_NAME_SUFFIX} PATH_SUFFIXES "lib") + + if (ZLIB_INCLUDE_DIR AND ZLIB_SHARED_LIB) + set(ZLIB_FOUND TRUE) +diff --git a/cmake_modules/FindZSTD.cmake b/cmake_modules/FindZSTD.cmake +index 810e5c0..d272d8f 100644 +--- a/cmake_modules/FindZSTD.cmake ++++ b/cmake_modules/FindZSTD.cmake +@@ -22,30 +22,16 @@ + # ZSTD_STATIC_LIB, path to libzstd static library + # ZSTD_FOUND, whether zstd has been found + +-if( NOT "${ZSTD_HOME}" STREQUAL "") +- file( TO_CMAKE_PATH "${ZSTD_HOME}" _native_path ) +- list( APPEND _zstd_roots ${_native_path} ) +-elseif ( ZStd_HOME ) +- list( APPEND _zstd_roots ${ZStd_HOME} ) +-endif() ++find_path(ZSTD_INCLUDE_DIR NAMES zstd.h ++ PATH_SUFFIXES "include" ) + +-if (MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX) +- set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static") ++if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") ++ set(ZSTD_LIB_NAME_SUFFIX "d") ++else() ++ set(ZSTD_LIB_NAME_SUFFIX "") + endif() + +-set(ZSTD_STATIC_LIB_SUFFIX +- "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") +- +-set(ZSTD_STATIC_LIB_NAME +- ${CMAKE_STATIC_LIBRARY_PREFIX}zstd${ZSTD_STATIC_LIB_SUFFIX}) +- +-find_path(ZSTD_INCLUDE_DIR NAMES zstd.h +- PATHS ${_zstd_roots} +- NO_DEFAULT_PATH +- PATH_SUFFIXES "include" ) -find_library(ZSTD_STATIC_LIB NAMES ${ZSTD_STATIC_LIB_NAME} lib${ZSTD_STATIC_LIB_NAME} -+find_library(ZSTD_STATIC_LIB NAMES zstd ${ZSTD_STATIC_LIB_NAME} lib${ZSTD_STATIC_LIB_NAME} - PATHS ${_zstd_roots} - NO_DEFAULT_PATH +- PATHS ${_zstd_roots} +- NO_DEFAULT_PATH ++find_library(ZSTD_STATIC_LIB NAMES zstd${ZSTD_LIB_NAME_SUFFIX} zstd_static${ZSTD_LIB_NAME_SUFFIX} PATH_SUFFIXES "lib" ) + + include(FindPackageHandleStandardArgs) +diff --git a/cmake_modules/Finddouble-conversion.cmake b/cmake_modules/Finddouble-conversion.cmake +new file mode 100644 +index 0000000..4fa0995 +--- /dev/null ++++ b/cmake_modules/Finddouble-conversion.cmake +@@ -0,0 +1,23 @@ ++# Licensed to the Apache Software Foundation (ASF) under one ++# or more contributor license agreements. See the NOTICE file ++# distributed with this work for additional information ++# regarding copyright ownership. The ASF licenses this file ++# to you under the Apache License, Version 2.0 (the ++# "License"); you may not use this file except in compliance ++# with the License. You may obtain a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, ++# software distributed under the License is distributed on an ++# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ++# KIND, either express or implied. See the License for the ++# specific language governing permissions and limitations ++# under the License. ++ ++find_path(DOUBLE_CONVERSION_INCLUDE_DIR NAMES double-conversion.h PATH_SUFFIXES "include/double-conversion" ) ++ ++find_library(DOUBLE_CONVERSION_STATIC_LIB NAMES double-conversion PATH_SUFFIXES "lib" ) ++ ++include(FindPackageHandleStandardArgs) ++find_package_handle_standard_args(DOUBLE_CONVERSION REQUIRED_VARS DOUBLE_CONVERSION_STATIC_LIB DOUBLE_CONVERSION_INCLUDE_DIR) +diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake +index 1c7cd62..572f6e1 100644 +--- a/cmake_modules/ThirdpartyToolchain.cmake ++++ b/cmake_modules/ThirdpartyToolchain.cmake +@@ -302,6 +302,8 @@ if (WIN32) + else() + find_library(PTHREAD_LIBRARY pthread) + message(STATUS "Found pthread: ${PTHREAD_LIBRARY}") ++ add_library(pthreadshared SHARED IMPORTED) ++ set_target_properties(pthreadshared PROPERTIES IMPORTED_LOCATION ${PTHREAD_LIBRARY}) + endif() + + # ---------------------------------------------------------------------- +@@ -322,106 +324,56 @@ set(Boost_ADDITIONAL_VERSIONS + "1.61.0" "1.62" + "1.60.0" "1.60") + +-if (ARROW_BOOST_VENDORED) +- set(BOOST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/boost_ep-prefix/src/boost_ep") +- set(BOOST_LIB_DIR "${BOOST_PREFIX}/stage/lib") +- set(BOOST_BUILD_LINK "static") +- set(BOOST_STATIC_SYSTEM_LIBRARY +- "${BOOST_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}boost_system${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(BOOST_STATIC_FILESYSTEM_LIBRARY +- "${BOOST_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}boost_filesystem${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(BOOST_STATIC_REGEX_LIBRARY +- "${BOOST_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}boost_regex${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(BOOST_SYSTEM_LIBRARY "${BOOST_STATIC_SYSTEM_LIBRARY}") +- set(BOOST_FILESYSTEM_LIBRARY "${BOOST_STATIC_FILESYSTEM_LIBRARY}") +- set(BOOST_REGEX_LIBRARY "${BOOST_STATIC_REGEX_LIBRARY}") ++if (MSVC) ++ # disable autolinking in boost ++ add_definitions(-DBOOST_ALL_NO_LIB) ++endif() ++if (ARROW_BOOST_USE_SHARED) ++ # Find shared Boost libraries. ++ set(Boost_USE_STATIC_LIBS OFF) ++ ++ if (MSVC) ++ # force all boost libraries to dynamic link ++ add_definitions(-DBOOST_ALL_DYN_LINK) ++ endif() ++ + if (ARROW_BOOST_HEADER_ONLY) +- set(BOOST_BUILD_PRODUCTS) +- set(BOOST_CONFIGURE_COMMAND "") +- set(BOOST_BUILD_COMMAND "") ++ find_package(Boost REQUIRED) + else() +- set(BOOST_BUILD_PRODUCTS +- ${BOOST_SYSTEM_LIBRARY} +- ${BOOST_FILESYSTEM_LIBRARY} +- ${BOOST_REGEX_LIBRARY}) +- set(BOOST_CONFIGURE_COMMAND +- "./bootstrap.sh" +- "--prefix=${BOOST_PREFIX}" +- "--with-libraries=filesystem,regex,system") ++ find_package(Boost COMPONENTS regex system filesystem REQUIRED) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") +- set(BOOST_BUILD_VARIANT "debug") ++ set(BOOST_SHARED_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_DEBUG}) ++ set(BOOST_SHARED_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_DEBUG}) ++ set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG}) + else() +- set(BOOST_BUILD_VARIANT "release") ++ set(BOOST_SHARED_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE}) ++ set(BOOST_SHARED_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE}) ++ set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE}) + endif() +- set(BOOST_BUILD_COMMAND +- "./b2" +- "link=${BOOST_BUILD_LINK}" +- "variant=${BOOST_BUILD_VARIANT}" +- "cxxflags=-fPIC") ++ set(BOOST_SYSTEM_LIBRARY boost_system_shared) ++ set(BOOST_FILESYSTEM_LIBRARY boost_filesystem_shared) ++ set(BOOST_REGEX_LIBRARY boost_regex_shared) + endif() +- ExternalProject_Add(boost_ep +- URL ${BOOST_SOURCE_URL} +- BUILD_BYPRODUCTS ${BOOST_BUILD_PRODUCTS} +- BUILD_IN_SOURCE 1 +- CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND} +- BUILD_COMMAND ${BOOST_BUILD_COMMAND} +- INSTALL_COMMAND "" +- ${EP_LOG_OPTIONS}) +- set(Boost_INCLUDE_DIR "${BOOST_PREFIX}") +- set(Boost_INCLUDE_DIRS "${BOOST_INCLUDE_DIR}") +- add_dependencies(arrow_dependencies boost_ep) + else() +- if (MSVC) +- # disable autolinking in boost +- add_definitions(-DBOOST_ALL_NO_LIB) +- endif() +- if (ARROW_BOOST_USE_SHARED) +- # Find shared Boost libraries. +- set(Boost_USE_STATIC_LIBS OFF) +- +- if (MSVC) +- # force all boost libraries to dynamic link +- add_definitions(-DBOOST_ALL_DYN_LINK) +- endif() +- +- if (ARROW_BOOST_HEADER_ONLY) +- find_package(Boost REQUIRED) +- else() +- find_package(Boost COMPONENTS regex system filesystem REQUIRED) +- if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") +- set(BOOST_SHARED_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_DEBUG}) +- set(BOOST_SHARED_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_DEBUG}) +- set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG}) +- else() +- set(BOOST_SHARED_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE}) +- set(BOOST_SHARED_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE}) +- set(BOOST_SHARED_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE}) +- endif() +- set(BOOST_SYSTEM_LIBRARY boost_system_shared) +- set(BOOST_FILESYSTEM_LIBRARY boost_filesystem_shared) +- set(BOOST_REGEX_LIBRARY boost_regex_shared) +- endif() ++ # Find static boost headers and libs ++ # TODO Differentiate here between release and debug builds ++ set(Boost_USE_STATIC_LIBS ON) ++ if (ARROW_BOOST_HEADER_ONLY) ++ find_package(Boost REQUIRED) + else() +- # Find static boost headers and libs +- # TODO Differentiate here between release and debug builds +- set(Boost_USE_STATIC_LIBS ON) +- if (ARROW_BOOST_HEADER_ONLY) +- find_package(Boost REQUIRED) ++ find_package(Boost COMPONENTS regex system filesystem REQUIRED) ++ if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") ++ set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_DEBUG}) ++ set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_DEBUG}) ++ set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG}) + else() +- find_package(Boost COMPONENTS regex system filesystem REQUIRED) +- if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") +- set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_DEBUG}) +- set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_DEBUG}) +- set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_DEBUG}) +- else() +- set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE}) +- set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE}) +- set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE}) +- endif() +- set(BOOST_SYSTEM_LIBRARY boost_system_static) +- set(BOOST_FILESYSTEM_LIBRARY boost_filesystem_static) +- set(BOOST_REGEX_LIBRARY boost_regex_static) ++ set(BOOST_STATIC_SYSTEM_LIBRARY ${Boost_SYSTEM_LIBRARY_RELEASE}) ++ set(BOOST_STATIC_FILESYSTEM_LIBRARY ${Boost_FILESYSTEM_LIBRARY_RELEASE}) ++ set(BOOST_STATIC_REGEX_LIBRARY ${Boost_REGEX_LIBRARY_RELEASE}) + endif() ++ set(BOOST_SYSTEM_LIBRARY boost_system_static) ++ set(BOOST_FILESYSTEM_LIBRARY boost_filesystem_static) ++ set(BOOST_REGEX_LIBRARY boost_regex_static) + endif() + endif() + +@@ -449,28 +401,8 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIR}) + # ---------------------------------------------------------------------- + # Google double-conversion + +-if("${DOUBLE_CONVERSION_HOME}" STREQUAL "") +- set(DOUBLE_CONVERSION_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/double-conversion_ep/src/double-conversion_ep") +- set(DOUBLE_CONVERSION_HOME "${DOUBLE_CONVERSION_PREFIX}") +- set(DOUBLE_CONVERSION_INCLUDE_DIR "${DOUBLE_CONVERSION_PREFIX}/include") +- set(DOUBLE_CONVERSION_STATIC_LIB "${DOUBLE_CONVERSION_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}double-conversion${CMAKE_STATIC_LIBRARY_SUFFIX}") +- +- set(DOUBLE_CONVERSION_CMAKE_ARGS +- "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" +- "-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}" +- "-DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS}" +- "-DCMAKE_INSTALL_PREFIX=${DOUBLE_CONVERSION_PREFIX}") +- ExternalProject_Add(double-conversion_ep +- ${EP_LOG_OPTIONS} +- INSTALL_DIR ${DOUBLE_CONVERSION_PREFIX} +- URL ${DOUBLE_CONVERSION_SOURCE_URL} +- CMAKE_ARGS ${DOUBLE_CONVERSION_CMAKE_ARGS} +- BUILD_BYPRODUCTS "${DOUBLE_CONVERSION_STATIC_LIB}") +- set(DOUBLE_CONVERSION_VENDORED 1) +-else() +- find_package(double-conversion REQUIRED) +- set(DOUBLE_CONVERSION_VENDORED 0) +-endif() ++find_package(double-conversion REQUIRED) ++set(DOUBLE_CONVERSION_VENDORED 0) + + include_directories(SYSTEM ${DOUBLE_CONVERSION_INCLUDE_DIR}) + ADD_THIRDPARTY_LIB(double-conversion +@@ -486,38 +418,8 @@ endif() + if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS) + add_custom_target(unittest ctest -L unittest) + +- if("${GTEST_HOME}" STREQUAL "") +- if(APPLE) +- set(GTEST_CMAKE_CXX_FLAGS "-fPIC -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-value -Wno-ignored-attributes") +- elseif(NOT MSVC) +- set(GTEST_CMAKE_CXX_FLAGS "-fPIC") +- endif() +- string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_BUILD_TYPE) +- set(GTEST_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}} ${GTEST_CMAKE_CXX_FLAGS}") +- +- set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/googletest_ep-prefix/src/googletest_ep") +- set(GTEST_INCLUDE_DIR "${GTEST_PREFIX}/include") +- set(GTEST_STATIC_LIB +- "${GTEST_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(GTEST_MAIN_STATIC_LIB +- "${GTEST_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(GTEST_VENDORED 1) +- set(GTEST_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- -DCMAKE_INSTALL_PREFIX=${GTEST_PREFIX} +- -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS}) +- if (MSVC AND NOT ARROW_USE_STATIC_CRT) +- set(GTEST_CMAKE_ARGS ${GTEST_CMAKE_ARGS} -Dgtest_force_shared_crt=ON) +- endif() +- +- ExternalProject_Add(googletest_ep +- URL ${GTEST_SOURCE_URL} +- BUILD_BYPRODUCTS ${GTEST_STATIC_LIB} ${GTEST_MAIN_STATIC_LIB} +- CMAKE_ARGS ${GTEST_CMAKE_ARGS} +- ${EP_LOG_OPTIONS}) +- else() +- find_package(GTest REQUIRED) +- set(GTEST_VENDORED 0) +- endif() ++ find_package(GTest REQUIRED) ++ set(GTEST_VENDORED 0) + + message(STATUS "GTest include dir: ${GTEST_INCLUDE_DIR}") + message(STATUS "GTest static library: ${GTEST_STATIC_LIB}") +@@ -533,40 +435,8 @@ if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS) + endif() + + # gflags (formerly Googleflags) command line parsing +- if("${GFLAGS_HOME}" STREQUAL "") +- set(GFLAGS_CMAKE_CXX_FLAGS ${EP_CXX_FLAGS}) +- +- set(GFLAGS_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gflags_ep-prefix/src/gflags_ep") +- set(GFLAGS_HOME "${GFLAGS_PREFIX}") +- set(GFLAGS_INCLUDE_DIR "${GFLAGS_PREFIX}/include") +- if(MSVC) +- set(GFLAGS_STATIC_LIB "${GFLAGS_PREFIX}/lib/gflags_static.lib") +- else() +- set(GFLAGS_STATIC_LIB "${GFLAGS_PREFIX}/lib/libgflags.a") +- endif() +- set(GFLAGS_VENDORED 1) +- set(GFLAGS_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- -DCMAKE_INSTALL_PREFIX=${GFLAGS_PREFIX} +- -DBUILD_SHARED_LIBS=OFF +- -DBUILD_STATIC_LIBS=ON +- -DBUILD_PACKAGING=OFF +- -DBUILD_TESTING=OFF +- -BUILD_CONFIG_TESTS=OFF +- -DINSTALL_HEADERS=ON +- -DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS} +- -DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_C_FLAGS} +- -DCMAKE_CXX_FLAGS=${GFLAGS_CMAKE_CXX_FLAGS}) +- +- ExternalProject_Add(gflags_ep +- URL ${GFLAGS_SOURCE_URL} +- ${EP_LOG_OPTIONS} +- BUILD_IN_SOURCE 1 +- BUILD_BYPRODUCTS "${GFLAGS_STATIC_LIB}" +- CMAKE_ARGS ${GFLAGS_CMAKE_ARGS}) +- else() +- set(GFLAGS_VENDORED 0) +- find_package(GFlags REQUIRED) +- endif() ++ set(GFLAGS_VENDORED 0) ++ find_package(GFlags REQUIRED) + + message(STATUS "GFlags include dir: ${GFLAGS_INCLUDE_DIR}") + message(STATUS "GFlags static library: ${GFLAGS_STATIC_LIB}") +@@ -587,37 +457,8 @@ endif() + if(ARROW_BUILD_BENCHMARKS) + add_custom_target(runbenchmark ctest -L benchmark) + +- if("$ENV{GBENCHMARK_HOME}" STREQUAL "") +- if(NOT MSVC) +- set(GBENCHMARK_CMAKE_CXX_FLAGS "-fPIC -std=c++11 ${EP_CXX_FLAGS}") +- endif() +- +- if(APPLE) +- set(GBENCHMARK_CMAKE_CXX_FLAGS "${GBENCHMARK_CMAKE_CXX_FLAGS} -stdlib=libc++") +- endif() +- +- set(GBENCHMARK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gbenchmark_ep/src/gbenchmark_ep-install") +- set(GBENCHMARK_INCLUDE_DIR "${GBENCHMARK_PREFIX}/include") +- set(GBENCHMARK_STATIC_LIB "${GBENCHMARK_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(GBENCHMARK_VENDORED 1) +- set(GBENCHMARK_CMAKE_ARGS +- "-DCMAKE_BUILD_TYPE=Release" +- "-DCMAKE_INSTALL_PREFIX:PATH=${GBENCHMARK_PREFIX}" +- "-DBENCHMARK_ENABLE_TESTING=OFF" +- "-DCMAKE_CXX_FLAGS=${GBENCHMARK_CMAKE_CXX_FLAGS}") +- if (APPLE) +- set(GBENCHMARK_CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS} "-DBENCHMARK_USE_LIBCXX=ON") +- endif() +- +- ExternalProject_Add(gbenchmark_ep +- URL ${GBENCHMARK_SOURCE_URL} +- BUILD_BYPRODUCTS "${GBENCHMARK_STATIC_LIB}" +- CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS} +- ${EP_LOG_OPTIONS}) +- else() +- find_package(GBenchmark REQUIRED) +- set(GBENCHMARK_VENDORED 0) +- endif() ++ find_package(GBenchmark REQUIRED) ++ set(GBENCHMARK_VENDORED 0) + + message(STATUS "GBenchmark include dir: ${GBENCHMARK_INCLUDE_DIR}") + message(STATUS "GBenchmark static library: ${GBENCHMARK_STATIC_LIB}") +@@ -632,24 +473,8 @@ endif() + + if (ARROW_IPC) + # RapidJSON, header only dependency +- if("${RAPIDJSON_HOME}" STREQUAL "") +- ExternalProject_Add(rapidjson_ep +- PREFIX "${CMAKE_BINARY_DIR}" +- URL ${RAPIDJSON_SOURCE_URL} +- URL_MD5 ${RAPIDJSON_SOURCE_MD5} +- CONFIGURE_COMMAND "" +- BUILD_COMMAND "" +- BUILD_IN_SOURCE 1 +- ${EP_LOG_OPTIONS} +- INSTALL_COMMAND "") +- +- ExternalProject_Get_Property(rapidjson_ep SOURCE_DIR) +- set(RAPIDJSON_INCLUDE_DIR "${SOURCE_DIR}/include") +- set(RAPIDJSON_VENDORED 1) +- else() +- set(RAPIDJSON_INCLUDE_DIR "${RAPIDJSON_HOME}/include") +- set(RAPIDJSON_VENDORED 0) +- endif() ++ set(RAPIDJSON_INCLUDE_DIR "${RAPIDJSON_HOME}/include") ++ set(RAPIDJSON_VENDORED 0) + message(STATUS "RapidJSON include dir: ${RAPIDJSON_INCLUDE_DIR}") + include_directories(SYSTEM ${RAPIDJSON_INCLUDE_DIR}) + +@@ -658,32 +483,8 @@ if (ARROW_IPC) + endif() + + ## Flatbuffers +- if("${FLATBUFFERS_HOME}" STREQUAL "") +- set(FLATBUFFERS_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/flatbuffers_ep-prefix/src/flatbuffers_ep-install") +- if (MSVC) +- set(FLATBUFFERS_CMAKE_CXX_FLAGS /EHsc) +- else() +- set(FLATBUFFERS_CMAKE_CXX_FLAGS -fPIC) +- endif() +- # We always need to do release builds, otherwise flatc will not be installed. +- ExternalProject_Add(flatbuffers_ep +- URL ${FLATBUFFERS_SOURCE_URL} +- CMAKE_ARGS +- "-DCMAKE_CXX_FLAGS=${FLATBUFFERS_CMAKE_CXX_FLAGS}" +- "-DCMAKE_INSTALL_PREFIX:PATH=${FLATBUFFERS_PREFIX}" +- "-DFLATBUFFERS_BUILD_TESTS=OFF" +- "-DCMAKE_BUILD_TYPE=RELEASE" +- "-DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS}" +- "-DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_C_FLAGS}" +- ${EP_LOG_OPTIONS}) +- +- set(FLATBUFFERS_INCLUDE_DIR "${FLATBUFFERS_PREFIX}/include") +- set(FLATBUFFERS_COMPILER "${FLATBUFFERS_PREFIX}/bin/flatc") +- set(FLATBUFFERS_VENDORED 1) +- else() +- find_package(Flatbuffers REQUIRED) +- set(FLATBUFFERS_VENDORED 0) +- endif() ++ find_package(Flatbuffers REQUIRED) ++ set(FLATBUFFERS_VENDORED 0) + + if(FLATBUFFERS_VENDORED) + add_dependencies(arrow_dependencies flatbuffers_ep) +@@ -787,34 +588,7 @@ if (ARROW_WITH_ZLIB) + if(ZLIB_FOUND) + ADD_THIRDPARTY_LIB(zlib SHARED_LIB ${ZLIB_SHARED_LIB}) + else() +- set(ZLIB_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/zlib_ep/src/zlib_ep-install") +- set(ZLIB_HOME "${ZLIB_PREFIX}") +- set(ZLIB_INCLUDE_DIR "${ZLIB_PREFIX}/include") +- if (MSVC) +- if (${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG") +- set(ZLIB_STATIC_LIB_NAME zlibstaticd.lib) +- else() +- set(ZLIB_STATIC_LIB_NAME zlibstatic.lib) +- endif() +- else() +- set(ZLIB_STATIC_LIB_NAME libz.a) +- endif() +- set(ZLIB_STATIC_LIB "${ZLIB_PREFIX}/lib/${ZLIB_STATIC_LIB_NAME}") +- set(ZLIB_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- -DCMAKE_INSTALL_PREFIX=${ZLIB_PREFIX} +- -DCMAKE_C_FLAGS=${EP_C_FLAGS} +- -DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS} +- -DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_C_FLAGS} +- -DBUILD_SHARED_LIBS=OFF) +- ADD_THIRDPARTY_LIB(zlib +- STATIC_LIB ${ZLIB_STATIC_LIB}) +- +- ExternalProject_Add(zlib_ep +- URL ${ZLIB_SOURCE_URL} +- ${EP_LOG_OPTIONS} +- BUILD_BYPRODUCTS "${ZLIB_STATIC_LIB}" +- CMAKE_ARGS ${ZLIB_CMAKE_ARGS}) +- add_dependencies(zlib zlib_ep) ++ message(FATAL_ERROR "zlib not found.") + endif() + + include_directories(SYSTEM ${ZLIB_INCLUDE_DIR}) +@@ -824,62 +598,8 @@ if (ARROW_WITH_SNAPPY) + # ---------------------------------------------------------------------- + # Snappy + +- if("${SNAPPY_HOME}" STREQUAL "") +- set(SNAPPY_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/snappy_ep/src/snappy_ep-install") +- set(SNAPPY_HOME "${SNAPPY_PREFIX}") +- set(SNAPPY_INCLUDE_DIR "${SNAPPY_PREFIX}/include") +- if (MSVC) +- set(SNAPPY_STATIC_LIB_NAME snappy_static) +- else() +- set(SNAPPY_STATIC_LIB_NAME snappy) +- endif() +- set(SNAPPY_STATIC_LIB "${SNAPPY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${SNAPPY_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") +- +- if (${UPPERCASE_BUILD_TYPE} EQUAL "RELEASE") +- if (APPLE) +- set(SNAPPY_CXXFLAGS "CXXFLAGS='-DNDEBUG -O1'") +- else() +- set(SNAPPY_CXXFLAGS "CXXFLAGS='-DNDEBUG -O2'") +- endif() +- endif() +- +- if (WIN32) +- set(SNAPPY_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- "-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}" +- "-DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS}" +- "-DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_C_FLAGS}" +- "-DCMAKE_C_FLAGS=${EP_C_FLAGS}" +- "-DCMAKE_INSTALL_PREFIX=${SNAPPY_PREFIX}") +- set(SNAPPY_UPDATE_COMMAND ${CMAKE_COMMAND} -E copy +- ${CMAKE_SOURCE_DIR}/cmake_modules/SnappyCMakeLists.txt +- ./CMakeLists.txt && +- ${CMAKE_COMMAND} -E copy +- ${CMAKE_SOURCE_DIR}/cmake_modules/SnappyConfig.h +- ./config.h) +- ExternalProject_Add(snappy_ep +- UPDATE_COMMAND ${SNAPPY_UPDATE_COMMAND} +- ${EP_LOG_OPTIONS} +- BUILD_IN_SOURCE 1 +- BUILD_COMMAND ${MAKE} +- INSTALL_DIR ${SNAPPY_PREFIX} +- URL ${SNAPPY_SOURCE_URL} +- CMAKE_ARGS ${SNAPPY_CMAKE_ARGS} +- BUILD_BYPRODUCTS "${SNAPPY_STATIC_LIB}") +- else() +- ExternalProject_Add(snappy_ep +- CONFIGURE_COMMAND ./configure --with-pic "--prefix=${SNAPPY_PREFIX}" ${SNAPPY_CXXFLAGS} +- ${EP_LOG_OPTIONS} +- BUILD_IN_SOURCE 1 +- BUILD_COMMAND ${MAKE} +- INSTALL_DIR ${SNAPPY_PREFIX} +- URL ${SNAPPY_SOURCE_URL} +- BUILD_BYPRODUCTS "${SNAPPY_STATIC_LIB}") +- endif() +- set(SNAPPY_VENDORED 1) +- else() +- find_package(Snappy REQUIRED) +- set(SNAPPY_VENDORED 0) +- endif() ++ find_package(Snappy REQUIRED) ++ set(SNAPPY_VENDORED 0) + + include_directories(SYSTEM ${SNAPPY_INCLUDE_DIR}) + ADD_THIRDPARTY_LIB(snappy +@@ -894,47 +614,8 @@ if (ARROW_WITH_BROTLI) + # ---------------------------------------------------------------------- + # Brotli + +- if("${BROTLI_HOME}" STREQUAL "") +- set(BROTLI_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/brotli_ep/src/brotli_ep-install") +- set(BROTLI_HOME "${BROTLI_PREFIX}") +- set(BROTLI_INCLUDE_DIR "${BROTLI_PREFIX}/include") +- if (MSVC) +- set(BROTLI_LIB_DIR bin) +- else() +- set(BROTLI_LIB_DIR lib) +- endif() +- set(BROTLI_STATIC_LIBRARY_ENC "${BROTLI_PREFIX}/${BROTLI_LIB_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}/${CMAKE_STATIC_LIBRARY_PREFIX}brotlienc${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(BROTLI_STATIC_LIBRARY_DEC "${BROTLI_PREFIX}/${BROTLI_LIB_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}/${CMAKE_STATIC_LIBRARY_PREFIX}brotlidec${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(BROTLI_STATIC_LIBRARY_COMMON "${BROTLI_PREFIX}/${BROTLI_LIB_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}/${CMAKE_STATIC_LIBRARY_PREFIX}brotlicommon${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(BROTLI_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- "-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}" +- "-DCMAKE_C_FLAGS=${EP_C_FLAGS}" +- "-DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS}" +- "-DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_C_FLAGS}" +- -DCMAKE_INSTALL_PREFIX=${BROTLI_PREFIX} +- -DCMAKE_INSTALL_LIBDIR=lib/${CMAKE_LIBRARY_ARCHITECTURE} +- -DBUILD_SHARED_LIBS=OFF) +- +- ExternalProject_Add(brotli_ep +- URL ${BROTLI_SOURCE_URL} +- BUILD_BYPRODUCTS "${BROTLI_STATIC_LIBRARY_ENC}" "${BROTLI_STATIC_LIBRARY_DEC}" "${BROTLI_STATIC_LIBRARY_COMMON}" +- ${BROTLI_BUILD_BYPRODUCTS} +- ${EP_LOG_OPTIONS} +- CMAKE_ARGS ${BROTLI_CMAKE_ARGS} +- STEP_TARGETS headers_copy) +- if (MSVC) +- ExternalProject_Get_Property(brotli_ep SOURCE_DIR) +- +- ExternalProject_Add_Step(brotli_ep headers_copy +- COMMAND xcopy /E /I include ..\\..\\..\\brotli_ep\\src\\brotli_ep-install\\include /Y +- DEPENDEES build +- WORKING_DIRECTORY ${SOURCE_DIR}) +- endif() +- set(BROTLI_VENDORED 1) +- else() +- find_package(Brotli REQUIRED) +- set(BROTLI_VENDORED 0) +- endif() ++ find_package(Brotli REQUIRED) ++ set(BROTLI_VENDORED 0) + + include_directories(SYSTEM ${BROTLI_INCLUDE_DIR}) + ADD_THIRDPARTY_LIB(brotli_enc +@@ -955,45 +636,8 @@ if (ARROW_WITH_LZ4) + # ---------------------------------------------------------------------- + # Lz4 + +- if("${LZ4_HOME}" STREQUAL "") +- set(LZ4_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/lz4_ep-prefix/src/lz4_ep") +- set(LZ4_HOME "${LZ4_BUILD_DIR}") +- set(LZ4_INCLUDE_DIR "${LZ4_BUILD_DIR}/lib") +- +- if (MSVC) +- if (ARROW_USE_STATIC_CRT) +- if (${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG") +- set(LZ4_RUNTIME_LIBRARY_LINKAGE "/p:RuntimeLibrary=MultiThreadedDebug") +- else() +- set(LZ4_RUNTIME_LIBRARY_LINKAGE "/p:RuntimeLibrary=MultiThreaded") +- endif() +- endif() +- set(LZ4_STATIC_LIB "${LZ4_BUILD_DIR}/visual/VS2010/bin/x64_${CMAKE_BUILD_TYPE}/liblz4_static.lib") +- set(LZ4_BUILD_COMMAND BUILD_COMMAND msbuild.exe /m /p:Configuration=${CMAKE_BUILD_TYPE} /p:Platform=x64 /p:PlatformToolset=v140 +- ${LZ4_RUNTIME_LIBRARY_LINKAGE} /t:Build ${LZ4_BUILD_DIR}/visual/VS2010/lz4.sln) +- set(LZ4_PATCH_COMMAND PATCH_COMMAND git --git-dir=. apply --verbose --whitespace=fix ${CMAKE_SOURCE_DIR}/build-support/lz4_msbuild_gl_runtimelibrary_params.patch) +- else() +- set(LZ4_STATIC_LIB "${LZ4_BUILD_DIR}/lib/liblz4.a") +- set(LZ4_BUILD_COMMAND BUILD_COMMAND ${CMAKE_SOURCE_DIR}/build-support/build-lz4-lib.sh) +- endif() +- +- ExternalProject_Add(lz4_ep +- URL ${LZ4_SOURCE_URL} +- ${EP_LOG_OPTIONS} +- UPDATE_COMMAND "" +- ${LZ4_PATCH_COMMAND} +- CONFIGURE_COMMAND "" +- INSTALL_COMMAND "" +- BINARY_DIR ${LZ4_BUILD_DIR} +- BUILD_BYPRODUCTS ${LZ4_STATIC_LIB} +- ${LZ4_BUILD_COMMAND} +- ) +- +- set(LZ4_VENDORED 1) +- else() +- find_package(Lz4 REQUIRED) +- set(LZ4_VENDORED 0) +- endif() ++ find_package(Lz4 REQUIRED) ++ set(LZ4_VENDORED 0) + + include_directories(SYSTEM ${LZ4_INCLUDE_DIR}) + ADD_THIRDPARTY_LIB(lz4_static +@@ -1008,45 +652,8 @@ if (ARROW_WITH_ZSTD) + # ---------------------------------------------------------------------- + # ZSTD + +- if("${ZSTD_HOME}" STREQUAL "") +- set(ZSTD_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/zstd_ep-prefix/src/zstd_ep") +- set(ZSTD_INCLUDE_DIR "${ZSTD_BUILD_DIR}/lib") +- +- if (MSVC) +- if (ARROW_USE_STATIC_CRT) +- if (${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG") +- set(ZSTD_RUNTIME_LIBRARY_LINKAGE "/p:RuntimeLibrary=MultiThreadedDebug") +- else() +- set(ZSTD_RUNTIME_LIBRARY_LINKAGE "/p:RuntimeLibrary=MultiThreaded") +- endif() +- endif() +- set(ZSTD_STATIC_LIB "${ZSTD_BUILD_DIR}/build/VS2010/bin/x64_${CMAKE_BUILD_TYPE}/libzstd_static.lib") +- set(ZSTD_BUILD_COMMAND BUILD_COMMAND msbuild ${ZSTD_BUILD_DIR}/build/VS2010/zstd.sln /t:Build /v:minimal /p:Configuration=${CMAKE_BUILD_TYPE} +- ${ZSTD_RUNTIME_LIBRARY_LINKAGE} /p:Platform=x64 /p:PlatformToolset=v140 +- /p:OutDir=${ZSTD_BUILD_DIR}/build/VS2010/bin/x64_${CMAKE_BUILD_TYPE}/ /p:SolutionDir=${ZSTD_BUILD_DIR}/build/VS2010/ ) +- set(ZSTD_PATCH_COMMAND PATCH_COMMAND git --git-dir=. apply --verbose --whitespace=fix ${CMAKE_SOURCE_DIR}/build-support/zstd_msbuild_gl_runtimelibrary_params.patch) +- else() +- set(ZSTD_STATIC_LIB "${ZSTD_BUILD_DIR}/lib/libzstd.a") +- set(ZSTD_BUILD_COMMAND BUILD_COMMAND ${CMAKE_SOURCE_DIR}/build-support/build-zstd-lib.sh) +- endif() +- +- ExternalProject_Add(zstd_ep +- URL ${ZSTD_SOURCE_URL} +- ${EP_LOG_OPTIONS} +- UPDATE_COMMAND "" +- ${ZSTD_PATCH_COMMAND} +- CONFIGURE_COMMAND "" +- INSTALL_COMMAND "" +- BINARY_DIR ${ZSTD_BUILD_DIR} +- BUILD_BYPRODUCTS ${ZSTD_STATIC_LIB} +- ${ZSTD_BUILD_COMMAND} +- ) +- +- set(ZSTD_VENDORED 1) +- else() +- find_package(ZSTD REQUIRED) +- set(ZSTD_VENDORED 0) +- endif() ++ find_package(ZSTD REQUIRED) ++ set(ZSTD_VENDORED 0) + + include_directories(SYSTEM ${ZSTD_INCLUDE_DIR}) + ADD_THIRDPARTY_LIB(zstd_static +@@ -1063,24 +670,8 @@ endif() + + if (ARROW_ORC OR ARROW_FLIGHT) + # protobuf +- if ("${PROTOBUF_HOME}" STREQUAL "") +- set (PROTOBUF_PREFIX "${THIRDPARTY_DIR}/protobuf_ep-install") +- set (PROTOBUF_HOME "${PROTOBUF_PREFIX}") +- set (PROTOBUF_INCLUDE_DIR "${PROTOBUF_PREFIX}/include") +- set (PROTOBUF_STATIC_LIB "${PROTOBUF_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}") +- +- ExternalProject_Add(protobuf_ep +- CONFIGURE_COMMAND "./configure" "--disable-shared" "--prefix=${PROTOBUF_PREFIX}" "CXXFLAGS=${EP_CXX_FLAGS}" +- BUILD_IN_SOURCE 1 +- URL ${PROTOBUF_SOURCE_URL} +- BUILD_BYPRODUCTS "${PROTOBUF_STATIC_LIB}" +- ${EP_LOG_OPTIONS}) +- +- set (PROTOBUF_VENDORED 1) +- else () +- find_package (Protobuf REQUIRED) +- set (PROTOBUF_VENDORED 0) +- endif () ++ find_package (Protobuf REQUIRED) ++ set (PROTOBUF_VENDORED 0) + + include_directories (SYSTEM ${PROTOBUF_INCLUDE_DIR}) + if (ARROW_PROTOBUF_USE_SHARED) +@@ -1100,34 +691,8 @@ endif() + # Dependencies for Arrow Flight RPC + + if (ARROW_FLIGHT) +- if ("${GRPC_HOME}" STREQUAL "") +- set(GRPC_VENDORED 1) +- set(GRPC_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/grpc_ep-prefix/src/grpc_ep-build") +- set(GRPC_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/grpc_ep/src/grpc_ep-install") +- set(GRPC_HOME "${GRPC_PREFIX}") +- set(GRPC_INCLUDE_DIR "${GRPC_PREFIX}/include") +- set(GRPC_STATIC_LIBRARY_GPR "${GRPC_BUILD_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gpr${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(GRPC_STATIC_LIBRARY_GRPC "${GRPC_BUILD_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}grpc${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(GRPC_STATIC_LIBRARY_GRPCPP "${GRPC_BUILD_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}grpcpp${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(GRPC_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- "-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}" +- "-DCMAKE_C_FLAGS=${EP_C_FLAGS}" +- -DCMAKE_INSTALL_PREFIX=${GRPC_PREFIX} +- -DBUILD_SHARED_LIBS=OFF) +- +- ExternalProject_Add(grpc_ep +- GIT_REPOSITORY "https://github.com/grpc/grpc" +- GIT_TAG ${GRPC_VERSION} +- BUILD_BYPRODUCTS "${GRPC_STATIC_LIBRARY_GPR}" "${GRPC_STATIC_LIBRARY_GRPC}" "${GRPC_STATIC_LIBRARY_GRPCPP}" +- ${GRPC_BUILD_BYPRODUCTS} +- ${EP_LOG_OPTIONS} +- CMAKE_ARGS ${GRPC_CMAKE_ARGS} +- ${EP_LOG_OPTIONS}) +- include_directories(SYSTEM ${GRPC_INCLUDE_DIR}) +- else() +- find_package(gRPC CONFIG REQUIRED) +- set(GRPC_VENDORED 0) +- endif() ++ find_package(gRPC CONFIG REQUIRED) ++ set(GRPC_VENDORED 0) + + get_property(GPR_STATIC_LIB TARGET gRPC::gpr PROPERTY LOCATION) + ADD_THIRDPARTY_LIB(grpc_gpr +@@ -1157,60 +722,9 @@ endif() + + if (ARROW_ORC) + # orc +- if ("${ORC_HOME}" STREQUAL "") +- set(ORC_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/orc_ep-install") +- set(ORC_HOME "${ORC_PREFIX}") +- set(ORC_INCLUDE_DIR "${ORC_PREFIX}/include") +- set(ORC_STATIC_LIB "${ORC_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}orc${CMAKE_STATIC_LIBRARY_SUFFIX}") +- +- if ("${COMPILER_FAMILY}" STREQUAL "clang") +- if ("${COMPILER_VERSION}" VERSION_GREATER "4.0") +- set(ORC_CMAKE_CXX_FLAGS " -Wno-zero-as-null-pointer-constant \ +- -Wno-inconsistent-missing-destructor-override ") +- endif() +- endif() +- +- set(ORC_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS} ${ORC_CMAKE_CXX_FLAGS}") +- +- # Since LZ4 isn't installed, the header file is in ${LZ4_HOME}/lib instead of +- # ${LZ4_HOME}/include, which forces us to specify the include directory +- # manually as well. +- set (ORC_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- -DCMAKE_INSTALL_PREFIX=${ORC_PREFIX} +- -DCMAKE_CXX_FLAGS=${ORC_CMAKE_CXX_FLAGS} +- -DBUILD_LIBHDFSPP=OFF +- -DBUILD_JAVA=OFF +- -DBUILD_TOOLS=OFF +- -DBUILD_CPP_TESTS=OFF +- -DINSTALL_VENDORED_LIBS=OFF +- -DPROTOBUF_HOME=${PROTOBUF_HOME} +- -DLZ4_HOME=${LZ4_HOME} +- -DLZ4_INCLUDE_DIR=${LZ4_INCLUDE_DIR} +- -DSNAPPY_HOME=${SNAPPY_HOME} +- -DZLIB_HOME=${ZLIB_HOME}) +- +- ExternalProject_Add(orc_ep +- URL ${ORC_SOURCE_URL} +- BUILD_BYPRODUCTS ${ORC_STATIC_LIB} +- CMAKE_ARGS ${ORC_CMAKE_ARGS} +- ${EP_LOG_OPTIONS}) +- +- set(ORC_VENDORED 1) +- add_dependencies(orc_ep zlib) +- if (LZ4_VENDORED) +- add_dependencies(orc_ep lz4_static) +- endif() +- if (SNAPPY_VENDORED) +- add_dependencies(orc_ep snappy) +- endif() +- if (PROTOBUF_VENDORED) +- add_dependencies(orc_ep protobuf_ep) +- endif() +- else() +- set(ORC_INCLUDE_DIR "${ORC_HOME}/include") +- set(ORC_STATIC_LIB "${ORC_HOME}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}orc${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(ORC_VENDORED 0) +- endif() ++ set(ORC_INCLUDE_DIR "${ORC_HOME}/include") ++ set(ORC_STATIC_LIB "${ORC_HOME}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}orc${CMAKE_STATIC_LIBRARY_SUFFIX}") ++ set(ORC_VENDORED 0) + + include_directories(SYSTEM ${ORC_INCLUDE_DIR}) + ADD_THIRDPARTY_LIB(orc +@@ -1231,97 +745,7 @@ if (ARROW_WITH_THRIFT) + # find thrift headers and libs + find_package(Thrift) + +-if (NOT THRIFT_FOUND) +- set(THRIFT_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/thrift_ep/src/thrift_ep-install") +- set(THRIFT_HOME "${THRIFT_PREFIX}") +- set(THRIFT_INCLUDE_DIR "${THRIFT_PREFIX}/include") +- set(THRIFT_COMPILER "${THRIFT_PREFIX}/bin/thrift") +- set(THRIFT_CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" +- "-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}" +- "-DCMAKE_C_FLAGS=${EP_C_FLAGS}" +- "-DCMAKE_INSTALL_PREFIX=${THRIFT_PREFIX}" +- "-DCMAKE_INSTALL_RPATH=${THRIFT_PREFIX}/lib" +- "-DBUILD_SHARED_LIBS=OFF" +- "-DBUILD_TESTING=OFF" +- "-DBUILD_EXAMPLES=OFF" +- "-DBUILD_TUTORIALS=OFF" +- "-DWITH_QT4=OFF" +- "-DWITH_C_GLIB=OFF" +- "-DWITH_JAVA=OFF" +- "-DWITH_PYTHON=OFF" +- "-DWITH_HASKELL=OFF" +- "-DWITH_CPP=ON" +- "-DWITH_STATIC_LIB=ON" +- "-DWITH_LIBEVENT=OFF" +- ) +- +- # Thrift also uses boost. Forward important boost settings if there were ones passed. +- if (DEFINED BOOST_ROOT) +- set(THRIFT_CMAKE_ARGS ${THRIFT_CMAKE_ARGS} "-DBOOST_ROOT=${BOOST_ROOT}") +- endif() +- if (DEFINED Boost_NAMESPACE) +- set(THRIFT_CMAKE_ARGS ${THRIFT_CMAKE_ARGS} "-DBoost_NAMESPACE=${Boost_NAMESPACE}") +- endif() +- +- set(THRIFT_STATIC_LIB_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}thrift") +- if (MSVC) +- if (ARROW_USE_STATIC_CRT) +- set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}mt") +- set(THRIFT_CMAKE_ARGS ${THRIFT_CMAKE_ARGS} "-DWITH_MT=ON") +- else() +- set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}md") +- set(THRIFT_CMAKE_ARGS ${THRIFT_CMAKE_ARGS} "-DWITH_MT=OFF") +- endif() +- endif() +- if (${UPPERCASE_BUILD_TYPE} STREQUAL "DEBUG") +- set(THRIFT_STATIC_LIB_NAME "${THRIFT_STATIC_LIB_NAME}d") +- endif() +- set(THRIFT_STATIC_LIB "${THRIFT_PREFIX}/lib/${THRIFT_STATIC_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}") +- +- if (ZLIB_SHARED_LIB) +- set(THRIFT_CMAKE_ARGS "-DZLIB_LIBRARY=${ZLIB_SHARED_LIB}" +- ${THRIFT_CMAKE_ARGS}) +- else() +- set(THRIFT_CMAKE_ARGS "-DZLIB_LIBRARY=${ZLIB_STATIC_LIB}" +- ${THRIFT_CMAKE_ARGS}) +- endif() +- set(THRIFT_DEPENDENCIES ${THRIFT_DEPENDENCIES} zlib) +- +- if (MSVC) +- set(WINFLEXBISON_VERSION 2.4.9) +- set(WINFLEXBISON_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/winflexbison_ep/src/winflexbison_ep-install") +- ExternalProject_Add(winflexbison_ep +- URL https://github.com/lexxmark/winflexbison/releases/download/v.${WINFLEXBISON_VERSION}/win_flex_bison-${WINFLEXBISON_VERSION}.zip +- URL_HASH MD5=a2e979ea9928fbf8567e995e9c0df765 +- SOURCE_DIR ${WINFLEXBISON_PREFIX} +- CONFIGURE_COMMAND "" +- BUILD_COMMAND "" +- INSTALL_COMMAND "" +- ${EP_LOG_OPTIONS}) +- set(THRIFT_DEPENDENCIES ${THRIFT_DEPENDENCIES} winflexbison_ep) +- +- set(THRIFT_CMAKE_ARGS "-DFLEX_EXECUTABLE=${WINFLEXBISON_PREFIX}/win_flex.exe" +- "-DBISON_EXECUTABLE=${WINFLEXBISON_PREFIX}/win_bison.exe" +- "-DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIR}" +- "-DWITH_SHARED_LIB=OFF" +- "-DWITH_PLUGIN=OFF" +- ${THRIFT_CMAKE_ARGS}) +- elseif (APPLE) +- if (DEFINED BISON_EXECUTABLE) +- set(THRIFT_CMAKE_ARGS "-DBISON_EXECUTABLE=${BISON_EXECUTABLE}" +- ${THRIFT_CMAKE_ARGS}) +- endif() +- endif() +- +- ExternalProject_Add(thrift_ep +- URL ${THRIFT_SOURCE_URL} +- BUILD_BYPRODUCTS "${THRIFT_STATIC_LIB}" "${THRIFT_COMPILER}" +- CMAKE_ARGS ${THRIFT_CMAKE_ARGS} +- DEPENDS ${THRIFT_DEPENDENCIES} +- ${EP_LOG_OPTIONS}) +- +- set(THRIFT_VENDORED 1) +-else() ++if (THRIFT_FOUND) + set(THRIFT_VENDORED 0) + endif() + +@@ -1347,45 +771,8 @@ endif() # ARROW_HIVESERVER2 + # GLOG + + if (ARROW_USE_GLOG) +- if("${GLOG_HOME}" STREQUAL "") +- set(GLOG_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/glog_ep-prefix/src/glog_ep") +- set(GLOG_INCLUDE_DIR "${GLOG_BUILD_DIR}/include") +- set(GLOG_STATIC_LIB "${GLOG_BUILD_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}glog${CMAKE_STATIC_LIBRARY_SUFFIX}") +- set(GLOG_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") +- set(GLOG_CMAKE_C_FLAGS "${EP_C_FLAGS} -fPIC") +- if (PTHREAD_LIBRARY) +- set(GLOG_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread") +- set(GLOG_CMAKE_C_FLAGS "${EP_C_FLAGS} -fPIC -pthread") +- endif() +- message(STATUS "GLOG_CMAKE_CXX_FLAGS: ${GLOG_CMAKE_CXX_FLAGS}") +- message(STATUS "CMAKE_CXX_FLAGS in glog: ${GLOG_CMAKE_CXX_FLAGS}") +- +- if(APPLE) +- # If we don't set this flag, the binary built with 10.13 cannot be used in 10.12. +- set(GLOG_CMAKE_CXX_FLAGS "${GLOG_CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9") +- endif() +- +- set(GLOG_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +- -DCMAKE_INSTALL_PREFIX=${GLOG_BUILD_DIR} +- -DBUILD_SHARED_LIBS=OFF +- -DBUILD_TESTING=OFF +- -DWITH_GFLAGS=OFF +- -DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${GLOG_CMAKE_CXX_FLAGS} +- -DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${GLOG_CMAKE_C_FLAGS} +- -DCMAKE_CXX_FLAGS=${GLOG_CMAKE_CXX_FLAGS}) +- message(STATUS "Glog version: ${GLOG_VERSION}") +- ExternalProject_Add(glog_ep +- URL ${GLOG_SOURCE_URL} +- BUILD_IN_SOURCE 1 +- BUILD_BYPRODUCTS "${GLOG_STATIC_LIB}" +- CMAKE_ARGS ${GLOG_CMAKE_ARGS} +- ${EP_LOG_OPTIONS}) +- +- set(GLOG_VENDORED 1) +- else() +- find_package(GLOG REQUIRED) +- set(GLOG_VENDORED 0) +- endif() ++ find_package(GLOG REQUIRED) ++ set(GLOG_VENDORED 0) + + message(STATUS "Glog include dir: ${GLOG_INCLUDE_DIR}") + message(STATUS "Glog static library: ${GLOG_STATIC_LIB}") diff --git a/ports/arrow/portfile.cmake b/ports/arrow/portfile.cmake index 4bd745ebf5e..73cf90eb20c 100644 --- a/ports/arrow/portfile.cmake +++ b/ports/arrow/portfile.cmake @@ -7,15 +7,15 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO apache/arrow - REF apache-arrow-0.9.0 - SHA512 789d0948eee3af20eb922e09c14eb721f20fa041ca3c0cf57bd869718fc9919b45590bd72714efafdf19196f35abb6bdbe0a3972ca74fcc2af92c1f9ade8fa00 + REF apache-arrow-0.11.1 + SHA512 8a2de7e4b40666e4ea7818fac488549f1348e961e7cb6a4166ae4019976a574fd115dc1cabaf44bc1cbaabf15fb8e5133c8232b34fca250d8ff7c5b65c5407c8 HEAD_REF master ) set(CPP_SOURCE_PATH "${SOURCE_PATH}/cpp") vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH ${CPP_SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/all.patch" ) @@ -23,6 +23,14 @@ vcpkg_apply_patches( string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "dynamic" ARROW_BUILD_SHARED) string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "static" ARROW_BUILD_STATIC) +string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "static" IS_STATIC) + +if (IS_STATIC) + set(PARQUET_ARROW_LINKAGE static) +else() + set(PARQUET_ARROW_LINKAGE shared) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${CPP_SOURCE_PATH} PREFER_NINJA @@ -38,18 +46,28 @@ vcpkg_configure_cmake( -DBOOST_ROOT=${CURRENT_INSTALLED_DIR} -DGFLAGS_HOME=${CURRENT_INSTALLED_DIR} -DZLIB_HOME=${CURRENT_INSTALLED_DIR} + -DARROW_PARQUET=ON -DARROW_BUILD_STATIC=${ARROW_BUILD_STATIC} -DARROW_BUILD_SHARED=${ARROW_BUILD_SHARED} + -DBUILD_STATIC=${ARROW_BUILD_STATIC} + -DBUILD_SHARED=${ARROW_BUILD_SHARED} + -DPARQUET_ARROW_LINKAGE=${PARQUET_ARROW_LINKAGE} + -DDOUBLE_CONVERSION_HOME=${CURRENT_INSTALLED_DIR} + -DGLOG_HOME=${CURRENT_INSTALLED_DIR} ) vcpkg_install_cmake() -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/arrow_static.lib ${CURRENT_PACKAGES_DIR}/lib/arrow.lib) - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/arrow_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/arrow.lib) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin) -else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/arrow_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/arrow_static.lib) +vcpkg_copy_pdbs() + +if(WIN32) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(RENAME ${CURRENT_PACKAGES_DIR}/lib/arrow_static.lib ${CURRENT_PACKAGES_DIR}/lib/arrow.lib) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/arrow_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/arrow.lib) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin ${CURRENT_PACKAGES_DIR}/bin) + else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/arrow_static.lib ${CURRENT_PACKAGES_DIR}/debug/lib/arrow_static.lib) + endif() endif() file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/arrow RENAME copyright) diff --git a/ports/parquet/CONTROL b/ports/parquet/CONTROL index c9288597e56..21584e8ee19 100644 --- a/ports/parquet/CONTROL +++ b/ports/parquet/CONTROL @@ -1,4 +1,4 @@ Source: parquet -Version: 1.4.0 -Build-Depends: arrow, thrift, gtest -Description: Parquet-cpp is a C++ library to read and write the Apache Parquet columnar data format. \ No newline at end of file +Version: 0 +Build-Depends: arrow +Description: Parquet-cpp is a C++ library to read and write the Apache Parquet columnar data format. It is now part of the arrow library. \ No newline at end of file diff --git a/ports/parquet/all.patch b/ports/parquet/all.patch deleted file mode 100644 index e9ec9966239..00000000000 --- a/ports/parquet/all.patch +++ /dev/null @@ -1,779 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 304f3fb..0b0fc1f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -16,7 +16,7 @@ - # under the License. - - # Require cmake that supports BYPRODUCTS in add_custom_command, ExternalProject_Add [1]. --cmake_minimum_required(VERSION 3.2.0) -+cmake_minimum_required(VERSION 3.8) - - file(READ "${CMAKE_CURRENT_SOURCE_DIR}/.parquetcppversion" PARQUET_VERSION) - string(REPLACE "\n" "" PARQUET_VERSION "${PARQUET_VERSION}") -@@ -25,6 +25,10 @@ if(NOT VERSION) - message(FATAL_ERROR "invalid .parquetcppversion") - endif() - -+if(NOT DEFINED ARROW_LIB_SUFFIX) -+ set(ARROW_LIB_SUFFIX "") -+endif() -+ - project(parquet-cpp VERSION ${VERSION}) - set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "C++ library to read and write the Apache Parquet columnar data format") - set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -@@ -528,37 +532,25 @@ endif() - ############################################################# - # Apache Arrow linkage - --if ("${PARQUET_ARROW_LINKAGE}" STREQUAL "shared") -+if ("${PARQUET_ARROW_LINKAGE}" STREQUAL "dynamic") - set(ARROW_LINK_LIBS -- arrow) -+ arrow_static) - else() - ############################################################# - # Transitive Library Linkage -- -- if (NOT DEFINED ENV{BROTLI_STATIC_LIB_ENC} OR -- NOT DEFINED ENV{BROTLI_STATIC_LIB_DEC} OR -- NOT DEFINED ENV{BROTLI_STATIC_LIB_COMMON} OR -- NOT DEFINED ENV{SNAPPY_STATIC_LIB} OR -- NOT DEFINED ENV{ZLIB_STATIC_LIB} OR -- NOT DEFINED ENV{LZ4_STATIC_LIB} OR -- NOT DEFINED ENV{ZSTD_STATIC_LIB}) -- message(FATAL_ERROR "Missing transitive dependencies for Arrow static linking") -- endif() -- -- set(BROTLI_STATIC_LIB_ENC "$ENV{BROTLI_STATIC_LIB_ENC}") -- set(BROTLI_STATIC_LIB_DEC "$ENV{BROTLI_STATIC_LIB_DEC}") -- set(BROTLI_STATIC_LIB_COMMON "$ENV{BROTLI_STATIC_LIB_COMMON}") -- set(SNAPPY_STATIC_LIB "$ENV{SNAPPY_STATIC_LIB}") -- set(ZLIB_STATIC_LIB "$ENV{ZLIB_STATIC_LIB}") -- set(LZ4_STATIC_LIB "$ENV{LZ4_STATIC_LIB}") -- set(ZSTD_STATIC_LIB "$ENV{ZSTD_STATIC_LIB}") -- -+ -+ find_package(Brotli REQUIRED) -+ find_package(Snappy REQUIRED) -+ find_package(LZ4 REQUIRED) -+ find_package(ZLIB REQUIRED) -+ find_package(ZSTD REQUIRED) -+ - add_library(brotli_enc STATIC IMPORTED) -- set_target_properties(brotli_enc PROPERTIES IMPORTED_LOCATION ${BROTLI_STATIC_LIB_ENC}) -+ set_target_properties(brotli_enc PROPERTIES IMPORTED_LOCATION ${BROTLI_STATIC_LIBRARY_ENC}) - add_library(brotli_dec STATIC IMPORTED) -- set_target_properties(brotli_dec PROPERTIES IMPORTED_LOCATION ${BROTLI_STATIC_LIB_DEC}) -+ set_target_properties(brotli_dec PROPERTIES IMPORTED_LOCATION ${BROTLI_STATIC_LIBRARY_DEC}) - add_library(brotli_common STATIC IMPORTED) -- set_target_properties(brotli_common PROPERTIES IMPORTED_LOCATION ${BROTLI_STATIC_LIB_COMMON}) -+ set_target_properties(brotli_common PROPERTIES IMPORTED_LOCATION ${BROTLI_STATIC_LIBRARY_COMMON}) - add_library(snappy STATIC IMPORTED) - set_target_properties(snappy PROPERTIES IMPORTED_LOCATION ${SNAPPY_STATIC_LIB}) - add_library(zlib STATIC IMPORTED) -@@ -588,9 +580,7 @@ endif() - ############################################################# - # Test linking - --set(PARQUET_MIN_TEST_LIBS -- gtest -- gtest_main) -+set(PARQUET_MIN_TEST_LIBS GTest::GTest GTest::Main) - - if (APPLE) - set(PARQUET_MIN_TEST_LIBS -diff --git a/cmake_modules/FindArrow.cmake b/cmake_modules/FindArrow.cmake -index b63b1af..3329c4a 100644 ---- a/cmake_modules/FindArrow.cmake -+++ b/cmake_modules/FindArrow.cmake -@@ -22,76 +22,21 @@ - # ARROW_SHARED_LIB, path to libarrow's shared library - # ARROW_FOUND, whether arrow has been found - --if (DEFINED ENV{ARROW_HOME}) -- set(ARROW_HOME "$ENV{ARROW_HOME}") --endif() -- --if ("${ARROW_HOME}" STREQUAL "") -- # PARQUET-955. If the user has set $ARROW_HOME in the environment, we respect -- # this, otherwise try to locate the pkgconfig in the system environment -- pkg_check_modules(ARROW arrow) -- if (ARROW_FOUND) -- # We found the pkgconfig -- set(ARROW_INCLUDE_DIR ${ARROW_INCLUDE_DIRS}) -- -- if (COMMAND pkg_get_variable) -- pkg_get_variable(ARROW_ABI_VERSION arrow abi_version) -- else() -- set(ARROW_ABI_VERSION "") -- endif() -- if (ARROW_ABI_VERSION STREQUAL "") -- set(ARROW_SHARED_LIB_SUFFIX "") -- else() -- set(ARROW_SHARED_LIB_SUFFIX ".${ARROW_ABI_VERSION}") -- endif() -- -- set(ARROW_LIB_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}arrow) -- -- if (APPLE) -- set(ARROW_SHARED_LIB ${ARROW_LIBDIR}/${ARROW_LIB_NAME}${ARROW_SHARED_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) -- else() -- set(ARROW_SHARED_LIB ${ARROW_LIBDIR}/${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}${ARROW_SHARED_LIB_SUFFIX}) -- endif() -- set(ARROW_STATIC_LIB ${ARROW_LIBDIR}/${ARROW_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) -- endif() --else() -- set(ARROW_HOME "${ARROW_HOME}") -+find_path(ARROW_INCLUDE_DIR arrow/array.h -+ PATH_SUFFIXES "include" -+ ) - -- if (MSVC AND NOT ARROW_MSVC_STATIC_LIB_SUFFIX) -- set(ARROW_MSVC_STATIC_LIB_SUFFIX _static) -- endif() -+find_library(ARROW_LIB_PATH NAMES arrow) - -- set(ARROW_SEARCH_HEADER_PATHS -- ${ARROW_HOME}/include -- ) -+if (ARROW_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR ARROW_LIB_PATH)) -+ set(ARROW_FOUND TRUE) -+ set(ARROW_HEADER_NAME arrow/api.h) -+ set(ARROW_HEADER ${ARROW_INCLUDE_DIR}/${ARROW_HEADER_NAME}) -+ set(ARROW_LIB_NAME arrow) - -- set(ARROW_SEARCH_LIB_PATH -- ${ARROW_HOME}/lib -- ) -- -- find_path(ARROW_INCLUDE_DIR arrow/array.h PATHS -- ${ARROW_SEARCH_HEADER_PATHS} -- # make sure we don't accidentally pick up a different version -- NO_DEFAULT_PATH -- ) -- -- find_library(ARROW_LIB_PATH NAMES arrow arrow${ARROW_MSVC_STATIC_LIB_SUFFIX} -- PATHS -- ${ARROW_SEARCH_LIB_PATH} -- NO_DEFAULT_PATH) -- -- if (ARROW_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR ARROW_LIB_PATH)) -- set(ARROW_FOUND TRUE) -- set(ARROW_HEADER_NAME arrow/api.h) -- set(ARROW_HEADER ${ARROW_INCLUDE_DIR}/${ARROW_HEADER_NAME}) -- set(ARROW_LIB_NAME arrow) -- -- get_filename_component(ARROW_LIBS ${ARROW_LIB_PATH} DIRECTORY) -- set(ARROW_STATIC_LIB ${ARROW_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${ARROW_LIB_NAME}${ARROW_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -- set(ARROW_SHARED_LIB ${ARROW_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) -- set(ARROW_SHARED_IMPLIB ${ARROW_LIBS}/${ARROW_LIB_NAME}.lib) -- endif () --endif() -+ set(ARROW_STATIC_LIB ${ARROW_LIB_PATH}) -+ set(ARROW_SHARED_LIB ${ARROW_LIB_PATH}) -+endif () - - if (ARROW_FOUND) - if (NOT Arrow_FIND_QUIETLY) -diff --git a/cmake_modules/FindBrotli.cmake b/cmake_modules/FindBrotli.cmake -index f2e714c..9561660 100644 ---- a/cmake_modules/FindBrotli.cmake -+++ b/cmake_modules/FindBrotli.cmake -@@ -17,13 +17,6 @@ - # - # find_package(Brotli) - # --# Variables used by this module, they can change the default behaviour and need --# to be set before calling find_package: --# --# Brotli_HOME - When set, this path is inspected instead of standard library --# locations as the root of the Brotli installation. --# The environment variable BROTLI_HOME overrides this veriable. --# - # This module defines - # BROTLI_INCLUDE_DIR, directory containing headers - # BROTLI_LIBS, directory containing brotli libraries -@@ -31,80 +24,37 @@ - # BROTLI_SHARED_LIB, path to libbrotli's shared library - # BROTLI_FOUND, whether brotli has been found - --if( NOT "${BROTLI_HOME}" STREQUAL "") -- file( TO_CMAKE_PATH "${BROTLI_HOME}" _native_path ) -- list( APPEND _brotli_roots ${_native_path} ) --elseif ( Brotli_HOME ) -- list( APPEND _brotli_roots ${Brotli_HOME} ) --endif() -- - find_path( BROTLI_INCLUDE_DIR NAMES brotli/decode.h -- PATHS ${_brotli_roots} -- NO_DEFAULT_PATH - PATH_SUFFIXES "include" ) -- --find_library( BROTLI_LIBRARY_ENC NAMES libbrotlienc.a brotlienc -- PATHS ${_brotli_roots} -- NO_DEFAULT_PATH -- PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ) -- --find_library( BROTLI_LIBRARY_DEC NAMES libbrotlidec.a brotlidec -- PATHS ${_brotli_roots} -- NO_DEFAULT_PATH -- PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ) -- --find_library( BROTLI_LIBRARY_COMMON NAMES libbrotlicommon.a brotlicommon -- PATHS ${_brotli_roots} -- NO_DEFAULT_PATH -- PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" ) -+ -+find_library( BROTLI_LIBRARY_ENC NAMES libbrotlienc.a brotlienc brotlienc-static ) -+find_library( BROTLI_LIBRARY_DEC NAMES libbrotlidec.a brotlidec brotlidec-static ) -+find_library( BROTLI_LIBRARY_COMMON NAMES libbrotlicommon.a brotlicommon brotlicommon-static ) - - set(BROTLI_LIBRARIES ${BROTLI_LIBRARY_ENC} ${BROTLI_LIBRARY_DEC} - ${BROTLI_LIBRARY_COMMON}) - --if (BROTLI_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR BROTLI_LIBRARIES)) -+if (BROTLI_INCLUDE_DIR) - set(BROTLI_FOUND TRUE) -- get_filename_component( BROTLI_LIBS ${BROTLI_LIBRARY_ENC} PATH ) -- set(BROTLI_LIB_NAME brotli) -- if (MSVC AND NOT BROTLI_MSVC_STATIC_LIB_SUFFIX) -- set(BROTLI_MSVC_STATIC_LIB_SUFFIX _static) -- endif() - set(BROTLI_STATIC_LIB -- ${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}enc${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} -- ${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}dec${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} -- ${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}common${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -- set(BROTLI_STATIC_LIBRARY_ENC ${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}enc${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -- set(BROTLI_STATIC_LIBRARY_DEC ${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}dec${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -- set(BROTLI_STATIC_LIBRARY_COMMON ${BROTLI_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${BROTLI_LIB_NAME}common${BROTLI_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -+ ${BROTLI_LIBRARY_ENC} -+ ${BROTLI_LIBRARY_DEC} -+ ${BROTLI_LIBRARY_COMMON}) -+ set(BROTLI_STATIC_LIBRARY_ENC ${BROTLI_LIBRARY_ENC}) -+ set(BROTLI_STATIC_LIBRARY_DEC ${BROTLI_LIBRARY_DEC}) -+ set(BROTLI_STATIC_LIBRARY_COMMON ${BROTLI_LIBRARY_COMMON}) - set(BROTLI_SHARED_LIB -- ${BROTLI_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${BROTLI_LIB_NAME}enc${CMAKE_SHARED_LIBRARY_SUFFIX} -- ${BROTLI_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${BROTLI_LIB_NAME}dec${CMAKE_SHARED_LIBRARY_SUFFIX} -- ${BROTLI_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${BROTLI_LIB_NAME}common${CMAKE_SHARED_LIBRARY_SUFFIX}) -+ ${BROTLI_LIBRARY_ENC} -+ ${BROTLI_LIBRARY_DEC} -+ ${BROTLI_LIBRARY_COMMON}) - else () - set(BROTLI_FOUND FALSE) - endif () - - if (BROTLI_FOUND) -- if (NOT Brotli_FIND_QUIETLY) -- if (PARQUET_MINIMAL_DEPENDENCY) -- message(STATUS "Found the Brotli headers: ${BROTLI_INCLUDE_DIR}") -- else () -- message(STATUS "Found the Brotli library: ${BROTLI_LIBRARIES}") -- endif () -- endif () -+ message(STATUS "Found the Brotli library: ${BROTLI_LIBRARIES}") - else () -- if (NOT Brotli_FIND_QUIETLY) -- set(BROTLI_ERR_MSG "Could not find the Brotli library. Looked in ") -- if ( _brotli_roots ) -- set(BROTLI_ERR_MSG "${BROTLI_ERR_MSG} in ${_brotli_roots}.") -- else () -- set(BROTLI_ERR_MSG "${BROTLI_ERR_MSG} system search paths.") -- endif () -- if (Brotli_FIND_REQUIRED) -- message(FATAL_ERROR "${BROTLI_ERR_MSG}") -- else (Brotli_FIND_REQUIRED) -- message(STATUS "${BROTLI_ERR_MSG}") -- endif (Brotli_FIND_REQUIRED) -- endif () -+ message(FATAL_ERROR "Could not find the Brotli library.") - endif () - - mark_as_advanced( -diff --git a/cmake_modules/FindGTest.cmake b/cmake_modules/FindGTest.cmake -deleted file mode 100644 -index c6ea16b..0000000 ---- a/cmake_modules/FindGTest.cmake -+++ /dev/null -@@ -1,94 +0,0 @@ --# --# Licensed under the Apache License, Version 2.0 (the "License"); --# you may not use this file except in compliance with the License. --# You may obtain a copy of the License at --# --# http://www.apache.org/licenses/LICENSE-2.0 --# --# Unless required by applicable law or agreed to in writing, software --# distributed under the License is distributed on an "AS IS" BASIS, --# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --# See the License for the specific language governing permissions and --# limitations under the License. --# --# Tries to find GTest headers and libraries. --# --# Usage of this module as follows: --# --# find_package(GTest) --# --# Variables used by this module, they can change the default behaviour and need --# to be set before calling find_package: --# --# GTest_HOME - When set, this path is inspected instead of standard library --# locations as the root of the GTest installation. --# The environment variable GTEST_HOME overrides this veriable. --# --# This module defines --# GTEST_INCLUDE_DIR, directory containing headers --# GTEST_LIBS, directory containing gtest libraries --# GTEST_STATIC_LIB, path to libgtest.a --# GTEST_MAIN_STATIC_LIB, path to libgtest_main.a --# GTEST_SHARED_LIB, path to libgtest's shared library --# GTEST_FOUND, whether gtest has been found -- --if( NOT "$ENV{GTEST_HOME}" STREQUAL "") -- file( TO_CMAKE_PATH "$ENV{GTEST_HOME}" _native_path ) -- list( APPEND _gtest_roots ${_native_path} ) --elseif ( GTest_HOME ) -- list( APPEND _gtest_roots ${GTest_HOME} ) --endif() -- --# Try the parameterized roots, if they exist --if ( _gtest_roots ) -- find_path( GTEST_INCLUDE_DIR NAMES gtest/gtest.h -- PATHS ${_gtest_roots} NO_DEFAULT_PATH -- PATH_SUFFIXES "include" ) -- find_library( GTEST_LIBRARIES NAMES gtest gtest_main -- PATHS ${_gtest_roots} NO_DEFAULT_PATH -- PATH_SUFFIXES "lib" ) --else () -- find_path( GTEST_INCLUDE_DIR NAMES gtest/gtest.h ) -- find_library( GTEST_LIBRARIES NAMES gtest ) --endif () -- -- --if (GTEST_INCLUDE_DIR AND GTEST_LIBRARIES) -- set(GTEST_FOUND TRUE) -- get_filename_component( GTEST_LIBS ${GTEST_LIBRARIES} PATH ) -- set(GTEST_LIB_NAME gtest) -- set(GTEST_STATIC_LIB ${GTEST_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${GTEST_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) -- set(GTEST_MAIN_STATIC_LIB ${GTEST_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${GTEST_LIB_NAME}_main${CMAKE_STATIC_LIBRARY_SUFFIX}) -- set(GTEST_SHARED_LIB ${GTEST_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${GTEST_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) --else () -- set(GTEST_FOUND FALSE) --endif () -- --if (GTEST_FOUND) -- if (NOT GTest_FIND_QUIETLY) -- message(STATUS "Found the GTest library: ${GTEST_LIBRARIES}") -- endif () --else () -- if (NOT GTest_FIND_QUIETLY) -- set(GTEST_ERR_MSG "Could not find the GTest library. Looked in ") -- if ( _gtest_roots ) -- set(GTEST_ERR_MSG "${GTEST_ERR_MSG} in ${_gtest_roots}.") -- else () -- set(GTEST_ERR_MSG "${GTEST_ERR_MSG} system search paths.") -- endif () -- if (GTest_FIND_REQUIRED) -- message(FATAL_ERROR "${GTEST_ERR_MSG}") -- else (GTest_FIND_REQUIRED) -- message(STATUS "${GTEST_ERR_MSG}") -- endif (GTest_FIND_REQUIRED) -- endif () --endif () -- --mark_as_advanced( -- GTEST_INCLUDE_DIR -- GTEST_LIBS -- GTEST_LIBRARIES -- GTEST_STATIC_LIB -- GTEST_MAIN_STATIC_LIB -- GTEST_SHARED_LIB --) -diff --git a/cmake_modules/FindLZ4.cmake b/cmake_modules/FindLZ4.cmake -new file mode 100644 -index 0000000..8458d7f ---- /dev/null -+++ b/cmake_modules/FindLZ4.cmake -@@ -0,0 +1,62 @@ -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+# Tries to find LZ4 headers and libraries. -+# -+# Usage of this module as follows: -+# -+# find_package(Snappy) -+# -+# This module defines -+# LZ4_INCLUDE_DIR, directory containing headers -+# LZ4_LIBS, directory containing LZ4 libraries -+# LZ4_STATIC_LIB, path to lz4.a -+# LZ4_SHARED_LIB, path to lz4's shared library -+# LZ4_FOUND, whether LZ4 has been found -+ -+find_path(LZ4_INCLUDE_DIR lz4.h -+ PATH_SUFFIXES "include") -+ -+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") -+ set(LZ4_LIB_SUFFIX "d") -+else() -+ set(LZ4_LIB_SUFFIX "") -+endif() -+ -+find_library( LZ4_LIBRARIES NAMES lz4${LZ4_LIB_SUFFIX} -+ PATH_SUFFIXES "lib") -+ -+if (LZ4_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR LZ4_LIBRARIES)) -+ set(LZ4_FOUND TRUE) -+ get_filename_component( LZ4_LIBS ${LZ4_LIBRARIES} PATH ) -+ set(LZ4_HEADER_NAME lz4.h) -+ set(LZ4_HEADER ${LZ4_INCLUDE_DIR}/${LZ4_HEADER_NAME}) -+ set(LZ4_STATIC_LIB ${LZ4_LIBRARIES}) -+ set(LZ4_SHARED_LIB ${LZ4_LIBRARIES}) -+else () -+ set(LZ4_FOUND FALSE) -+endif () -+ -+if (LZ4_FOUND) -+ message(STATUS "Found the LZ4 library: ${LZ4_LIBRARIES}") -+else () -+ message(FATAL_ERROR "Could not find the LZ4 library.") -+endif () -+ -+mark_as_advanced( -+ LZ4_INCLUDE_DIR -+ LZ4_LIBS -+ LZ4_LIBRARIES -+ LZ4_STATIC_LIB -+ LZ4_SHARED_LIB -+) -diff --git a/cmake_modules/FindSnappy.cmake b/cmake_modules/FindSnappy.cmake -index 867963c..cc68688 100644 ---- a/cmake_modules/FindSnappy.cmake -+++ b/cmake_modules/FindSnappy.cmake -@@ -17,13 +17,6 @@ - # - # find_package(Snappy) - # --# Variables used by this module, they can change the default behaviour and need --# to be set before calling find_package: --# --# Snappy_HOME - When set, this path is inspected instead of standard library --# locations as the root of the Snappy installation. --# The environment variable SNAPPY_HOME overrides this variable. --# - # This module defines - # SNAPPY_INCLUDE_DIR, directory containing headers - # SNAPPY_LIBS, directory containing snappy libraries -@@ -31,22 +24,16 @@ - # SNAPPY_SHARED_LIB, path to libsnappy's shared library - # SNAPPY_FOUND, whether snappy has been found - --if( NOT "${SNAPPY_HOME}" STREQUAL "") -- file( TO_CMAKE_PATH "${SNAPPY_HOME}" _native_path ) -- list( APPEND _snappy_roots ${_native_path} ) --elseif ( Snappy_HOME ) -- list( APPEND _snappy_roots ${Snappy_HOME} ) --endif() -- --message(STATUS "SNAPPY_HOME: ${SNAPPY_HOME}") --find_path(SNAPPY_INCLUDE_DIR snappy.h HINTS -- ${_snappy_roots} -- NO_DEFAULT_PATH -+find_path(SNAPPY_INCLUDE_DIR snappy.h - PATH_SUFFIXES "include") -+ -+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") -+ set(SNAPPY_LIB_SUFFIX "d") -+else() -+ set(SNAPPY_LIB_SUFFIX "") -+endif() - --find_library( SNAPPY_LIBRARIES NAMES snappy PATHS -- ${_snappy_roots} -- NO_DEFAULT_PATH -+find_library( SNAPPY_LIBRARIES NAMES snappy${SNAPPY_LIB_SUFFIX} - PATH_SUFFIXES "lib") - - if (SNAPPY_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR SNAPPY_LIBRARIES)) -@@ -54,9 +41,8 @@ if (SNAPPY_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR SNAPPY_LIBRARIES)) - get_filename_component( SNAPPY_LIBS ${SNAPPY_LIBRARIES} PATH ) - set(SNAPPY_HEADER_NAME snappy.h) - set(SNAPPY_HEADER ${SNAPPY_INCLUDE_DIR}/${SNAPPY_HEADER_NAME}) -- set(SNAPPY_LIB_NAME snappy) -- set(SNAPPY_STATIC_LIB ${SNAPPY_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${SNAPPY_LIB_NAME}${SNAPPY_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -- set(SNAPPY_SHARED_LIB ${SNAPPY_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${SNAPPY_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) -+ set(SNAPPY_STATIC_LIB ${SNAPPY_LIBRARIES}) -+ set(SNAPPY_SHARED_LIB ${SNAPPY_LIBRARIES}) - else () - set(SNAPPY_FOUND FALSE) - endif () -diff --git a/cmake_modules/FindThrift.cmake b/cmake_modules/FindThrift.cmake -index 25f5082..f27857f 100644 ---- a/cmake_modules/FindThrift.cmake -+++ b/cmake_modules/FindThrift.cmake -@@ -14,55 +14,28 @@ - - # - Find Thrift (a cross platform RPC lib/tool) - # --# Variables used by this module, they can change the default behaviour and need --# to be set before calling find_package: --# --# Thrift_HOME - When set, this path is inspected instead of standard library --# locations as the root of the Thrift installation. --# The environment variable THRIFT_HOME overrides this variable. --# - # This module defines - # THRIFT_VERSION, version string of ant if found - # THRIFT_INCLUDE_DIR, where to find THRIFT headers --# THRIFT_CONTRIB_DIR, where contrib thrift files (e.g. fb303.thrift) are installed - # THRIFT_STATIC_LIB, THRIFT static library - # THRIFT_FOUND, If false, do not try to use ant - --# prefer the thrift version supplied in THRIFT_HOME --if( NOT "${THRIFT_HOME}" STREQUAL "") -- file( TO_CMAKE_PATH "${THRIFT_HOME}" _native_path ) -- list( APPEND _thrift_roots ${_native_path} ) --elseif ( Thrift_HOME ) -- list( APPEND _thrift_roots ${Thrift_HOME} ) --endif() -- --message(STATUS "THRIFT_HOME: ${THRIFT_HOME}") --find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h HINTS -- ${_thrift_roots} -- NO_DEFAULT_PATH -+find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h - PATH_SUFFIXES "include" - ) - --find_path(THRIFT_CONTRIB_DIR share/fb303/if/fb303.thrift HINTS -- ${_thrift_roots} -- NO_DEFAULT_PATH --) -- --if (MSVC AND NOT THRIFT_MSVC_STATIC_LIB_SUFFIX) -- set(THRIFT_MSVC_STATIC_LIB_SUFFIX md) -+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") -+ set(THRIFT_LIB_SUFFIX mdd) -+else() -+ set(THRIFT_LIB_SUFFIX md) - endif() - - find_library(THRIFT_STATIC_LIB NAMES -- ${CMAKE_STATIC_LIBRARY_PREFIX}thrift${THRIFT_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} -- HINTS ${_thrift_roots} -- NO_DEFAULT_PATH -- PATH_SUFFIXES "lib/${CMAKE_LIBRARY_ARCHITECTURE}" "lib" -+ thrift${THRIFT_LIB_SUFFIX} - ) - - find_program(THRIFT_COMPILER thrift HINTS -- ${_thrift_roots} -- NO_DEFAULT_PATH -- PATH_SUFFIXES "bin" -+ PATH_SUFFIXES "tools" - ) - - if (THRIFT_STATIC_LIB) -@@ -94,7 +67,6 @@ else () - endif () - endif () - -- - mark_as_advanced( - THRIFT_STATIC_LIB - THRIFT_COMPILER -diff --git a/cmake_modules/FindZLIB.cmake b/cmake_modules/FindZLIB.cmake -index 78b84f2..1ef0305 100644 ---- a/cmake_modules/FindZLIB.cmake -+++ b/cmake_modules/FindZLIB.cmake -@@ -32,27 +32,17 @@ - # ZLIB_SHARED_LIB, path to libz's shared library - # ZLIB_FOUND, whether zlib has been found - --if( NOT "${ZLIB_HOME}" STREQUAL "") -- file( TO_CMAKE_PATH "${ZLIB_HOME}" _native_path ) -- list( APPEND _zlib_roots ${_native_path} ) --elseif ( ZLIB_HOME ) -- list( APPEND _zlib_roots ${ZLIB_HOME} ) -+find_path( ZLIB_INCLUDE_DIR NAMES zlib.h -+ PATH_SUFFIXES "include" ) -+ -+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") -+ set(ZLIB_LIB_SUFFIX "d") -+else() -+ set(ZLIB_LIB_SUFFIX "") - endif() -- --# Try the parameterized roots, if they exist --if ( _zlib_roots ) -- find_path( ZLIB_INCLUDE_DIR NAMES zlib.h -- PATHS ${_zlib_roots} NO_DEFAULT_PATH -- PATH_SUFFIXES "include" ) -- find_library( ZLIB_LIBRARIES NAMES libz.a zlib -- PATHS ${_zlib_roots} NO_DEFAULT_PATH -- PATH_SUFFIXES "lib" ) --else () -- find_path( ZLIB_INCLUDE_DIR NAMES zlib.h ) -- # Only look for the static library -- find_library( ZLIB_LIBRARIES NAMES libz.a zlib ) --endif () -- -+ -+find_library( ZLIB_LIBRARIES NAMES libz.a zlib${ZLIB_LIB_SUFFIX} -+ PATH_SUFFIXES "lib" ) - - if (ZLIB_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR ZLIB_LIBRARIES)) - set(ZLIB_FOUND TRUE) -@@ -66,8 +56,8 @@ if (ZLIB_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR ZLIB_LIBRARIES)) - endif() - set(ZLIB_MSVC_SHARED_LIB_SUFFIX lib) - endif() -- set(ZLIB_STATIC_LIB ${ZLIB_LIBS}/${CMAKE_STATIC_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${ZLIB_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -- set(ZLIB_SHARED_LIB ${ZLIB_LIBS}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${ZLIB_MSVC_SHARED_LIB_SUFFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}) -+ set(ZLIB_STATIC_LIB ${ZLIB_LIBRARIES}) -+ set(ZLIB_SHARED_LIB ${ZLIB_LIBRARIES}) - else () - set(ZLIB_FOUND FALSE) - endif () -diff --git a/cmake_modules/FindZSTD.cmake b/cmake_modules/FindZSTD.cmake -new file mode 100644 -index 0000000..062cfa9 ---- /dev/null -+++ b/cmake_modules/FindZSTD.cmake -@@ -0,0 +1,62 @@ -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); -+# you may not use this file except in compliance with the License. -+# You may obtain a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, -+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+# See the License for the specific language governing permissions and -+# limitations under the License. -+# -+# Tries to find ZSTD headers and libraries. -+# -+# Usage of this module as follows: -+# -+# find_package(Snappy) -+# -+# This module defines -+# ZSTD_INCLUDE_DIR, directory containing headers -+# ZSTD_LIBS, directory containing ZSTD libraries -+# ZSTD_STATIC_LIB, path to zstd.a -+# ZSTD_SHARED_LIB, path to ZSTD's shared library -+# ZSTD_FOUND, whether ZSTD has been found -+ -+find_path(ZSTD_INCLUDE_DIR ZSTD.h -+ PATH_SUFFIXES "include") -+ -+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG") -+ set(ZSTD_LIB_SUFFIX "d") -+else() -+ set(ZSTD_LIB_SUFFIX "") -+endif() -+ -+find_library( ZSTD_LIBRARIES NAMES zstd${ZSTD_LIB_SUFFIX} zstd_static${ZSTD_LIB_SUFFIX} -+ PATH_SUFFIXES "lib") -+ -+if (ZSTD_INCLUDE_DIR AND (PARQUET_MINIMAL_DEPENDENCY OR ZSTD_LIBRARIES)) -+ set(ZSTD_FOUND TRUE) -+ get_filename_component( ZSTD_LIBS ${ZSTD_LIBRARIES} PATH ) -+ set(ZSTD_HEADER_NAME zstd.h) -+ set(ZSTD_HEADER ${ZSTD_INCLUDE_DIR}/${ZSTD_HEADER_NAME}) -+ set(ZSTD_STATIC_LIB ${ZSTD_LIBRARIES}) -+ set(ZSTD_SHARED_LIB ${ZSTD_LIBRARIES}) -+else () -+ set(ZSTD_FOUND FALSE) -+endif () -+ -+if (ZSTD_FOUND) -+ message(STATUS "Found the ZSTD library: ${ZSTD_LIBRARIES}") -+else () -+ message(FATAL_ERROR "Could not find the ZSTD library.") -+endif () -+ -+mark_as_advanced( -+ ZSTD_INCLUDE_DIR -+ ZSTD_LIBS -+ ZSTD_LIBRARIES -+ ZSTD_STATIC_LIB -+ ZSTD_SHARED_LIB -+) -diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake -index 690fd0b..d74bb3d 100644 ---- a/cmake_modules/ThirdpartyToolchain.cmake -+++ b/cmake_modules/ThirdpartyToolchain.cmake -@@ -276,54 +276,11 @@ endif() - if(PARQUET_BUILD_TESTS AND NOT IGNORE_OPTIONAL_PACKAGES) - add_custom_target(unittest ctest -L unittest) - -- if("$ENV{GTEST_HOME}" STREQUAL "") -- if(APPLE) -- set(GTEST_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-value -Wno-ignored-attributes") -- else() -- set(GTEST_CMAKE_CXX_FLAGS "${EP_CXX_FLAGS}") -- endif() -- -- set(GTEST_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/googletest_ep-prefix/src/googletest_ep") -- set(GTEST_INCLUDE_DIR "${GTEST_PREFIX}/include") -- set(GTEST_STATIC_LIB -- "${GTEST_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}") -- set(GTEST_MAIN_STATIC_LIB -- "${GTEST_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}") -- -- set(GTEST_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -- -DCMAKE_INSTALL_PREFIX=${GTEST_PREFIX} -- -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS}) -- -- if (MSVC AND NOT PARQUET_USE_STATIC_CRT) -- set(GTEST_CMAKE_ARGS ${GTEST_CMAKE_ARGS} -Dgtest_force_shared_crt=ON) -- endif() -- -- ExternalProject_Add(googletest_ep -- URL "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz" -- BUILD_BYPRODUCTS "${GTEST_STATIC_LIB}" "${GTEST_MAIN_STATIC_LIB}" -- CMAKE_ARGS ${GTEST_CMAKE_ARGS} -- ${EP_LOG_OPTIONS}) -- set(GTEST_VENDORED 1) -- else() -- find_package(GTest REQUIRED) -- set(GTEST_VENDORED 0) -- endif() -+ find_package(GTest REQUIRED) -+ include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) - - message(STATUS "GTest include dir: ${GTEST_INCLUDE_DIR}") - message(STATUS "GTest static library: ${GTEST_STATIC_LIB}") -- include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) -- -- add_library(gtest STATIC IMPORTED) -- set_target_properties(gtest PROPERTIES IMPORTED_LOCATION ${GTEST_STATIC_LIB}) -- -- add_library(gtest_main STATIC IMPORTED) -- set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION -- ${GTEST_MAIN_STATIC_LIB}) -- -- if(GTEST_VENDORED) -- add_dependencies(gtest googletest_ep) -- add_dependencies(gtest_main googletest_ep) -- endif() - endif() - - ## Google Benchmark diff --git a/ports/parquet/portfile.cmake b/ports/parquet/portfile.cmake index 5a67bf3460e..593c1e136f1 100644 --- a/ports/parquet/portfile.cmake +++ b/ports/parquet/portfile.cmake @@ -1,51 +1,2 @@ -include(vcpkg_common_functions) - -if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - message(FATAL_ERROR "Apache Parquet only supports x64") -endif() - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO apache/parquet-cpp - REF apache-parquet-cpp-1.4.0 - SHA512 a6c12e39dcae123ae1893f7fc32bae32e32a1943182b1c0c1c2726134ee4fa6470d73a6ff8e3ce312eeb250d7fa35c9b9f3c227a35ba0aa6f873ce3954217bed - HEAD_REF master -) - -vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES - "${CMAKE_CURRENT_LIST_DIR}/all.patch" -) - -SET(ENV{GTEST_HOME} ${CURRENT_INSTALLED_DIR}) - -string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "dynamic" PARQUET_BUILD_SHARED) -string(COMPARE EQUAL ${VCPKG_LIBRARY_LINKAGE} "static" PARQUET_BUILD_STATIC) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS - -DTHRIFT_HOME=${CURRENT_INSTALLED_DIR} - -DARROW_HOME=${CURRENT_INSTALLED_DIR} - -DPARQUET_BUILD_STATIC=${PARQUET_BUILD_STATIC} - -DPARQUET_BUILD_SHARED=${PARQUET_BUILD_SHARED} - -DPARQUET_ARROW_LINKAGE=${VCPKG_LIBRARY_LINKAGE} - -DPARQUET_BUILD_TOOLCHAIN=${CURRENT_INSTALLED_DIR} - -DPARQUET_BOOST_USE_SHARED=${PARQUET_BUILD_SHARED} -) - -vcpkg_install_cmake() - -file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/parquet RENAME copyright) - -# Put CMake files in the right place -file(INSTALL ${CURRENT_PACKAGES_DIR}/cmake/parquet-cppConfig.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/parquet) -file(INSTALL ${CURRENT_PACKAGES_DIR}/cmake/parquet-cppConfigVersion.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/parquet RENAME parquet-cppConfigVersion-release.cmake) -file(INSTALL ${CURRENT_PACKAGES_DIR}/debug/cmake/parquet-cppConfigVersion.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/parquet RENAME parquet-cppConfigVersion-debug.cmake) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/cmake) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +# The parquet library has been merged into arrow +set(VCPKG_POLICY_EMPTY_PACKAGE enabled)