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-423: Define BUILD_BYPRODUCTS for CMake 3.2+
Date Thu, 15 Dec 2016 18:15:15 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 935279091 -> 063c190a5


ARROW-423: Define BUILD_BYPRODUCTS for CMake 3.2+

Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #240 from xhochy/ARROW-423 and squashes the following commits:

4c99ba2 [Uwe L. Korn] ARROW-423: Define BUILD_BYPRODUCTS for CMake 3.2+


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

Branch: refs/heads/master
Commit: 063c190a5252d8f77a37ebf80efcc68b70ffacab
Parents: 9352790
Author: Uwe L. Korn <uwelk@xhochy.com>
Authored: Thu Dec 15 13:15:08 2016 -0500
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Thu Dec 15 13:15:08 2016 -0500

----------------------------------------------------------------------
 cpp/CMakeLists.txt           | 91 ++++++++++++++++++++++++++-------------
 cpp/src/arrow/CMakeLists.txt |  2 -
 2 files changed, 61 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/063c190a/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index d288ffb..315995c 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -488,19 +488,32 @@ if(ARROW_BUILD_TESTS)
       set(GTEST_CMAKE_CXX_FLAGS "-fPIC")
     endif()
 
-    ExternalProject_Add(googletest_ep
-      URL "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz"
-      CMAKE_ARGS -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS} -Dgtest_force_shared_crt=ON
-      # googletest doesn't define install rules, so just build in the
-      # source dir and don't try to install.  See its README for
-      # details.
-      BUILD_IN_SOURCE 1
-      INSTALL_COMMAND "")
-
     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}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
     set(GTEST_VENDORED 1)
+
+    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"
+        CMAKE_ARGS -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS} -Dgtest_force_shared_crt=ON
+        # googletest doesn't define install rules, so just build in the
+        # source dir and don't try to install.  See its README for
+        # details.
+        BUILD_IN_SOURCE 1
+        BUILD_BYPRODUCTS "${GTEST_STATIC_LIB}"
+        INSTALL_COMMAND "")
+    else()
+      ExternalProject_Add(googletest_ep
+        URL "https://github.com/google/googletest/archive/release-${GTEST_VERSION}.tar.gz"
+        CMAKE_ARGS -DCMAKE_CXX_FLAGS=${GTEST_CMAKE_CXX_FLAGS} -Dgtest_force_shared_crt=ON
+        # googletest doesn't define install rules, so just build in the
+        # source dir and don't try to install.  See its README for
+        # details.
+        BUILD_IN_SOURCE 1
+        INSTALL_COMMAND "")
+    endif()
   else()
     find_package(GTest REQUIRED)
     set(GTEST_VENDORED 0)
@@ -525,24 +538,34 @@ if(ARROW_BUILD_TESTS)
     endif()
 
     set(GFLAGS_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gflags_ep-prefix/src/gflags_ep")
-    ExternalProject_Add(gflags_ep
-      GIT_REPOSITORY https://github.com/gflags/gflags.git
-      GIT_TAG cce68f0c9c5d054017425e6e6fd54f696d36e8ee
-      BUILD_IN_SOURCE 1
-      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=${GFLAGS_CMAKE_CXX_FLAGS})
-
     set(GFLAGS_HOME "${GFLAGS_PREFIX}")
     set(GFLAGS_INCLUDE_DIR "${GFLAGS_PREFIX}/include")
     set(GFLAGS_STATIC_LIB "${GFLAGS_PREFIX}/lib/libgflags.a")
     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=${GFLAGS_CMAKE_CXX_FLAGS})
+    if (CMAKE_VERSION VERSION_GREATER "3.2")
+      # BUILD_BYPRODUCTS is a 3.2+ feature
+      ExternalProject_Add(gflags_ep
+        GIT_REPOSITORY https://github.com/gflags/gflags.git
+        GIT_TAG cce68f0c9c5d054017425e6e6fd54f696d36e8ee
+        BUILD_IN_SOURCE 1
+        BUILD_BYPRODUCTS "${GFLAGS_STATIC_LIB}"
+        CMAKE_ARGS ${GFLAGS_CMAKE_ARGS})
+    else()
+      ExternalProject_Add(gflags_ep
+        GIT_REPOSITORY https://github.com/gflags/gflags.git
+        GIT_TAG cce68f0c9c5d054017425e6e6fd54f696d36e8ee
+        BUILD_IN_SOURCE 1
+        CMAKE_ARGS ${GFLAGS_CMAKE_ARGS})
+    endif()
   else()
     set(GFLAGS_VENDORED 0)
     find_package(GFlags REQUIRED)
@@ -570,16 +593,24 @@ if(ARROW_BUILD_BENCHMARKS)
     endif()
 
     set(GBENCHMARK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gbenchmark_ep/src/gbenchmark_ep-install")
-    ExternalProject_Add(gbenchmark_ep
-      URL "https://github.com/google/benchmark/archive/v${GBENCHMARK_VERSION}.tar.gz"
-      CMAKE_ARGS
-        "-DCMAKE_BUILD_TYPE=Release"
-        "-DCMAKE_INSTALL_PREFIX:PATH=${GBENCHMARK_PREFIX}"
-        "-DCMAKE_CXX_FLAGS=-fPIC ${GBENCHMARK_CMAKE_CXX_FLAGS}")
-
     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}"
+          "-DCMAKE_CXX_FLAGS=-fPIC ${GBENCHMARK_CMAKE_CXX_FLAGS}")
+    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()
   else()
     find_package(GBenchmark REQUIRED)
     set(GBENCHMARK_VENDORED 0)

http://git-wip-us.apache.org/repos/asf/arrow/blob/063c190a/cpp/src/arrow/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 7d7bc29..b8500ab 100644
--- a/cpp/src/arrow/CMakeLists.txt
+++ b/cpp/src/arrow/CMakeLists.txt
@@ -37,8 +37,6 @@ install(FILES
 # Unit tests
 #######################################
 
-set(ARROW_TEST_LINK_LIBS ${ARROW_MIN_TEST_LIBS})
-
 ADD_ARROW_TEST(array-test)
 ADD_ARROW_TEST(array-decimal-test)
 ADD_ARROW_TEST(array-list-test)


Mime
View raw message