arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject arrow git commit: ARROW-1148: [C++] Raise minimum CMake version to 3.2
Date Tue, 04 Jul 2017 15:35:55 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 7c18ddd4e -> edcded3c6


ARROW-1148: [C++] Raise minimum CMake version to 3.2

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #805 from wesm/ARROW-1148 and squashes the following commits:

db36f510 [Wes McKinney] Restore logic stripping -std=c++11 from cflags
b30f70ca [Wes McKinney] Fix cmake syntax errors
4a202399 [Wes McKinney] Raise minimum CMake version to 3.2


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/edcded3c
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/edcded3c
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/edcded3c

Branch: refs/heads/master
Commit: edcded3c6996a812188259c2cd4f8b75778defe4
Parents: 7c18ddd
Author: Wes McKinney <wes.mckinney@twosigma.com>
Authored: Tue Jul 4 11:35:50 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Tue Jul 4 11:35:50 2017 -0400

----------------------------------------------------------------------
 cpp/CMakeLists.txt                          | 16 +++--
 cpp/cmake_modules/ThirdpartyToolchain.cmake | 92 +++++++-----------------
 2 files changed, 35 insertions(+), 73 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/edcded3c/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 28a3bb0..76d89ce 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-cmake_minimum_required(VERSION 2.7)
+cmake_minimum_required(VERSION 3.2)
 project(arrow)
 
 file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../java/pom.xml" POM_XML)
@@ -29,12 +29,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")
 include(CMakeParseArguments)
 include(ExternalProject)
 
-if(CMAKE_MAJOR_VERSION LESS 3)
-  set(CMAKE_INSTALL_INCLUDEDIR "include")
-  set(CMAKE_INSTALL_LIBDIR "lib")
-else()
-  include(GNUInstallDirs)
-endif()
+# This ensures that things like gnu++11 get passed correctly
+set(CMAKE_CXX_STANDARD 11)
+
+# We require a C++11 compliant compiler
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+include(GNUInstallDirs)
 
 # Compatibility with CMake 3.1
 if(POLICY CMP0054)
@@ -214,6 +215,7 @@ include(san-config)
 
 # For any C code, use the same flags.
 set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
+
 # Remove --std=c++11 to avoid errors from C compilers
 string(REPLACE "-std=c++11" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/edcded3c/cpp/cmake_modules/ThirdpartyToolchain.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 3e09006..2be7b5a 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -202,17 +202,10 @@ if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
                          -Dgtest_force_shared_crt=ON
                          -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS})
 
-    if (CMAKE_VERSION VERSION_GREATER "3.2")
-      # BUILD_BYPRODUCTS is a 3.2+ feature
-      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})
-    else()
-      ExternalProject_Add(googletest_ep
-        URL "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz"
-        CMAKE_ARGS ${GTEST_CMAKE_ARGS})
-    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})
   else()
     find_package(GTest REQUIRED)
     set(GTEST_VENDORED 0)
@@ -254,19 +247,12 @@ if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
                           -BUILD_CONFIG_TESTS=OFF
                           -DINSTALL_HEADERS=ON
                           -DCMAKE_CXX_FLAGS=${GFLAGS_CMAKE_CXX_FLAGS})
-    if (CMAKE_VERSION VERSION_GREATER "3.2")
-      # BUILD_BYPRODUCTS is a 3.2+ feature
-      ExternalProject_Add(gflags_ep
-        URL ${GFLAGS_URL}
-        BUILD_IN_SOURCE 1
-        BUILD_BYPRODUCTS "${GFLAGS_STATIC_LIB}"
-        CMAKE_ARGS ${GFLAGS_CMAKE_ARGS})
-    else()
-      ExternalProject_Add(gflags_ep
-        URL ${GFLAGS_URL}
-        BUILD_IN_SOURCE 1
-        CMAKE_ARGS ${GFLAGS_CMAKE_ARGS})
-    endif()
+
+    ExternalProject_Add(gflags_ep
+      URL ${GFLAGS_URL}
+      BUILD_IN_SOURCE 1
+      BUILD_BYPRODUCTS "${GFLAGS_STATIC_LIB}"
+      CMAKE_ARGS ${GFLAGS_CMAKE_ARGS})
   else()
     set(GFLAGS_VENDORED 0)
     find_package(GFlags REQUIRED)
@@ -310,17 +296,11 @@ if(ARROW_BUILD_BENCHMARKS)
     if (APPLE)
       set(GBENCHMARK_CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS} "-DBENCHMARK_USE_LIBCXX=ON")
     endif()
-    if (CMAKE_VERSION VERSION_GREATER "3.2")
-      # BUILD_BYPRODUCTS is a 3.2+ feature
-      ExternalProject_Add(gbenchmark_ep
-        URL "https://github.com/google/benchmark/archive/v${GBENCHMARK_VERSION}.tar.gz"
-        BUILD_BYPRODUCTS "${GBENCHMARK_STATIC_LIB}"
-        CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS})
-    else()
-      ExternalProject_Add(gbenchmark_ep
-        URL "https://github.com/google/benchmark/archive/v${GBENCHMARK_VERSION}.tar.gz"
-        CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS})
-    endif()
+
+    ExternalProject_Add(gbenchmark_ep
+      URL "https://github.com/google/benchmark/archive/v${GBENCHMARK_VERSION}.tar.gz"
+      BUILD_BYPRODUCTS "${GBENCHMARK_STATIC_LIB}"
+      CMAKE_ARGS ${GBENCHMARK_CMAKE_ARGS})
   else()
     find_package(GBenchmark REQUIRED)
     set(GBENCHMARK_VENDORED 0)
@@ -407,23 +387,13 @@ if (ARROW_JEMALLOC)
     set(JEMALLOC_SHARED_LIB "${JEMALLOC_PREFIX}/lib/libjemalloc${CMAKE_SHARED_LIBRARY_SUFFIX}")
     set(JEMALLOC_STATIC_LIB "${JEMALLOC_PREFIX}/lib/libjemalloc_pic${CMAKE_STATIC_LIBRARY_SUFFIX}")
     set(JEMALLOC_VENDORED 1)
-    if (CMAKE_VERSION VERSION_GREATER "3.2")
-      # BUILD_BYPRODUCTS is a 3.2+ feature
-      ExternalProject_Add(jemalloc_ep
-        URL https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2
-        CONFIGURE_COMMAND ./configure "--prefix=${JEMALLOC_PREFIX}" "--with-jemalloc-prefix="
-        BUILD_IN_SOURCE 1
-        BUILD_COMMAND ${MAKE}
-        BUILD_BYPRODUCTS "${JEMALLOC_STATIC_LIB}" "${JEMALLOC_SHARED_LIB}"
-        INSTALL_COMMAND ${MAKE} -j1 install)
-    else()
-      ExternalProject_Add(jemalloc_ep
-        URL https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2
-        CONFIGURE_COMMAND ./configure "--prefix=${JEMALLOC_PREFIX}" "--with-jemalloc-prefix="
-        BUILD_IN_SOURCE 1
-        BUILD_COMMAND ${MAKE}
-        INSTALL_COMMAND ${MAKE} -j1 install)
-    endif()
+    ExternalProject_Add(jemalloc_ep
+      URL https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2
+      CONFIGURE_COMMAND ./configure "--prefix=${JEMALLOC_PREFIX}" "--with-jemalloc-prefix="
+      BUILD_IN_SOURCE 1
+      BUILD_COMMAND ${MAKE}
+      BUILD_BYPRODUCTS "${JEMALLOC_STATIC_LIB}" "${JEMALLOC_SHARED_LIB}"
+      INSTALL_COMMAND ${MAKE} -j1 install)
   else()
     set(JEMALLOC_VENDORED 0)
   endif()
@@ -501,12 +471,9 @@ if (NOT ZLIB_FOUND)
                       -DCMAKE_C_FLAGS=${EP_C_FLAGS}
                       -DBUILD_SHARED_LIBS=OFF)
 
-  if (CMAKE_VERSION VERSION_GREATER "3.2")
-    set(ZLIB_BUILD_BYPRODUCTS BUILD_BYPRODUCTS "${ZLIB_STATIC_LIB}")
-  endif()
   ExternalProject_Add(zlib_ep
     URL "http://zlib.net/fossils/zlib-1.2.8.tar.gz"
-    ${ZLIB_BUILD_BYPRODUCTS}
+    BUILD_BYPRODUCTS "${ZLIB_STATIC_LIB}"
     CMAKE_ARGS ${ZLIB_CMAKE_ARGS})
   set(ZLIB_VENDORED 1)
 else()
@@ -546,10 +513,6 @@ if (NOT SNAPPY_FOUND)
     endif()
   endif()
 
-  if (CMAKE_VERSION VERSION_GREATER "3.2")
-    set(SNAPPY_BUILD_BYPRODUCTS BUILD_BYPRODUCTS "${SNAPPY_STATIC_LIB}")
-  endif()
-
   if (MSVC)
     set(SNAPPY_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                           "-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}"
@@ -568,7 +531,7 @@ if (NOT SNAPPY_FOUND)
       INSTALL_DIR ${SNAPPY_PREFIX}
       URL ${SNAPPY_SRC_URL}
       CMAKE_ARGS ${SNAPPY_CMAKE_ARGS}
-      ${SNAPPY_BUILD_BYPRODUCTS})
+      BUILD_BYPRODUCTS "${SNAPPY_STATIC_LIB}")
   else()
     ExternalProject_Add(snappy_ep
       CONFIGURE_COMMAND ./configure --with-pic "--prefix=${SNAPPY_PREFIX}" ${SNAPPY_CXXFLAGS}
@@ -576,7 +539,7 @@ if (NOT SNAPPY_FOUND)
       BUILD_COMMAND ${MAKE}
       INSTALL_DIR ${SNAPPY_PREFIX}
       URL ${SNAPPY_SRC_URL}
-      ${SNAPPY_BUILD_BYPRODUCTS})
+      BUILD_BYPRODUCTS "${SNAPPY_STATIC_LIB}")
   endif()
   set(SNAPPY_VENDORED 1)
 else()
@@ -614,12 +577,9 @@ if (NOT BROTLI_FOUND)
                         -DCMAKE_INSTALL_LIBDIR=lib/${CMAKE_LIBRARY_ARCHITECTURE}
                         -DBUILD_SHARED_LIBS=OFF)
 
-  if (CMAKE_VERSION VERSION_GREATER "3.2")
-    set(BROTLI_BUILD_BYPRODUCTS BUILD_BYPRODUCTS "${BROTLI_STATIC_LIBRARY_ENC}" "${BROTLI_STATIC_LIBRARY_DEC}"
"${BROTLI_STATIC_LIBRARY_COMMON}")
-  endif()
-
   ExternalProject_Add(brotli_ep
     URL "https://github.com/google/brotli/archive/${BROTLI_VERSION}.tar.gz"
+    BUILD_BYPRODUCTS "${BROTLI_STATIC_LIBRARY_ENC}" "${BROTLI_STATIC_LIBRARY_DEC}" "${BROTLI_STATIC_LIBRARY_COMMON}"
     ${BROTLI_BUILD_BYPRODUCTS}
     CMAKE_ARGS ${BROTLI_CMAKE_ARGS}
     STEP_TARGETS headers_copy)


Mime
View raw message