arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject arrow git commit: ARROW-742: [C++] Use gflags from toolchain; Resolve cmake FindGFlags …
Date Sun, 18 Jun 2017 16:43:35 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 1a23419fb -> 5be05ac15


ARROW-742: [C++] Use gflags from toolchain; Resolve cmake FindGFlags …

…and FindGTest Windows issues.

Author: Max Risuhin <risuhin.max@gmail.com>

Closes #759 from MaxRis/ARROW-784 and squashes the following commits:

358a9cc [Max Risuhin] ARROW-742: [C++] Use gflags from toolchain; Resolve cmake FindGFlags
and FindGTest Windows issues.


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

Branch: refs/heads/master
Commit: 5be05ac154843908f87fb40f3e0bde5e256e8626
Parents: 1a23419
Author: Max Risuhin <risuhin.max@gmail.com>
Authored: Sun Jun 18 18:43:30 2017 +0200
Committer: Uwe L. Korn <uwelk@xhochy.com>
Committed: Sun Jun 18 18:43:30 2017 +0200

----------------------------------------------------------------------
 ci/msvc-build.bat                  |  2 +-
 cpp/CMakeLists.txt                 |  7 ++++++-
 cpp/cmake_modules/FindGFlags.cmake | 12 ++++++++----
 cpp/cmake_modules/FindGTest.cmake  |  9 +++++----
 4 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/5be05ac1/ci/msvc-build.bat
----------------------------------------------------------------------
diff --git a/ci/msvc-build.bat b/ci/msvc-build.bat
index 263d4bc..366fc28 100644
--- a/ci/msvc-build.bat
+++ b/ci/msvc-build.bat
@@ -23,7 +23,7 @@ conda create -n arrow -q -y python=%PYTHON% ^
       six pytest setuptools numpy pandas cython
 conda install -n arrow -q -y -c conda-forge ^
       flatbuffers rapidjson ^
-      cmake git boost-cpp thrift-cpp snappy zlib brotli
+      cmake git boost-cpp thrift-cpp snappy zlib brotli gflags
 
 call activate arrow
 

http://git-wip-us.apache.org/repos/asf/arrow/blob/5be05ac1/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index c295fa0..42e1f69 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -412,6 +412,7 @@ if (NOT "$ENV{ARROW_BUILD_TOOLCHAIN}" STREQUAL "")
   set(FLATBUFFERS_HOME "$ENV{ARROW_BUILD_TOOLCHAIN}")
   set(RAPIDJSON_HOME "$ENV{ARROW_BUILD_TOOLCHAIN}")
   set(JEMALLOC_HOME "$ENV{ARROW_BUILD_TOOLCHAIN}")
+  set(GFLAGS_HOME "$ENV{ARROW_BUILD_TOOLCHAIN}")
 
   if (NOT DEFINED ENV{BOOST_ROOT})
     # Since we have to set this in the environment, we check whether
@@ -432,6 +433,10 @@ if (DEFINED ENV{JEMALLOC_HOME})
   set(JEMALLOC_HOME "$ENV{JEMALLOC_HOME}")
 endif()
 
+if (DEFINED ENV{GFLAGS_HOME})
+  set(GFLAGS_HOME "$ENV{GFLAGS_HOME}")
+endif()
+
 # ----------------------------------------------------------------------
 # Add Boost dependencies (code adapted from Apache Kudu (incubating))
 
@@ -560,7 +565,7 @@ if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
   endif()
 
   # gflags (formerly Googleflags) command line parsing
-  if("$ENV{GFLAGS_HOME}" STREQUAL "")
+  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")

http://git-wip-us.apache.org/repos/asf/arrow/blob/5be05ac1/cpp/cmake_modules/FindGFlags.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/FindGFlags.cmake b/cpp/cmake_modules/FindGFlags.cmake
index eaea835..9eaf824 100644
--- a/cpp/cmake_modules/FindGFlags.cmake
+++ b/cpp/cmake_modules/FindGFlags.cmake
@@ -22,13 +22,17 @@
 #  GFLAGS_STATIC_LIB, path to libgflags static library
 #  GFLAGS_FOUND, whether gflags has been found
 
-if( NOT "$ENV{GFLAGS_HOME}" STREQUAL "")
-    file( TO_CMAKE_PATH "$ENV{GFLAGS_HOME}" _native_path )
+if( NOT "${GFLAGS_HOME}" STREQUAL "")
+    file( TO_CMAKE_PATH "${GFLAGS_HOME}" _native_path )
     list( APPEND _gflags_roots ${_native_path} )
 elseif ( GFlags_HOME )
     list( APPEND _gflags_roots ${GFlags_HOME} )
 endif()
 
+if (MSVC AND NOT GFLAGS_MSVC_STATIC_LIB_SUFFIX)
+  set(GFLAGS_MSVC_STATIC_LIB_SUFFIX "_static")
+endif()
+
 if ( _gflags_roots )
   find_path(GFLAGS_INCLUDE_DIR NAMES gflags/gflags.h
     PATHS ${_gflags_roots}
@@ -38,7 +42,7 @@ if ( _gflags_roots )
     PATHS ${_gflags_roots}
     NO_DEFAULT_PATH
     PATH_SUFFIXES "lib" )
-  find_library(GFLAGS_SHARED_LIB NAMES libgflags.a
+  find_library(GFLAGS_STATIC_LIB NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}gflags${GFLAGS_MSVC_STATIC_LIB_SUFFIX}
     PATHS ${_gflags_roots}
     NO_DEFAULT_PATH
     PATH_SUFFIXES "lib" )
@@ -50,7 +54,7 @@ else()
   find_library(GFLAGS_SHARED_LIB gflags
     NO_CMAKE_SYSTEM_PATH
     NO_SYSTEM_ENVIRONMENT_PATH)
-  find_library(GFLAGS_STATIC_LIB libgflags.a
+  find_library(GFLAGS_STATIC_LIB ${CMAKE_STATIC_LIBRARY_PREFIX}gflags${GFLAGS_MSVC_STATIC_LIB_SUFFIX}
     NO_CMAKE_SYSTEM_PATH
     NO_SYSTEM_ENVIRONMENT_PATH)
 endif()

http://git-wip-us.apache.org/repos/asf/arrow/blob/5be05ac1/cpp/cmake_modules/FindGTest.cmake
----------------------------------------------------------------------
diff --git a/cpp/cmake_modules/FindGTest.cmake b/cpp/cmake_modules/FindGTest.cmake
index 3c5d2b6..0e2af2f 100644
--- a/cpp/cmake_modules/FindGTest.cmake
+++ b/cpp/cmake_modules/FindGTest.cmake
@@ -43,7 +43,7 @@ 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
+    find_library( GTEST_LIBRARIES NAMES gtest gtest_main
         PATHS ${_gtest_roots} NO_DEFAULT_PATH
         PATH_SUFFIXES "lib" )
 else ()
@@ -55,9 +55,10 @@ endif ()
 if (GTEST_INCLUDE_DIR AND GTEST_LIBRARIES)
   set(GTEST_FOUND TRUE)
   get_filename_component( GTEST_LIBS ${GTEST_LIBRARIES} PATH )
-  set(GTEST_LIB_NAME libgtest)
-  set(GTEST_STATIC_LIB ${GTEST_LIBS}/${GTEST_LIB_NAME}.a)
-  set(GTEST_SHARED_LIB ${GTEST_LIBS}/${GTEST_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+  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 ()


Mime
View raw message