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-845: [Python] Sync changes from PARQUET-955; explicit ARROW_HOME will override pkgconfig
Date Tue, 18 Apr 2017 14:34:15 GMT
Repository: arrow
Updated Branches:
  refs/heads/master 0bcb7852f -> bb287e203


ARROW-845: [Python] Sync changes from PARQUET-955; explicit ARROW_HOME will override pkgconfig

This will avoid build failures due to a stale system-level Arrow install

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

Closes #558 from wesm/ARROW-845 and squashes the following commits:

4f89207 [Wes McKinney] Sync changes from PARQUET-955; explicit ARROW_HOME will override pkgconfig


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

Branch: refs/heads/master
Commit: bb287e2030c2b209edc4040099b138866e6e4692
Parents: 0bcb785
Author: Wes McKinney <wes.mckinney@twosigma.com>
Authored: Tue Apr 18 16:34:08 2017 +0200
Committer: Uwe L. Korn <uwelk@xhochy.com>
Committed: Tue Apr 18 16:34:08 2017 +0200

----------------------------------------------------------------------
 python/cmake_modules/FindArrow.cmake | 92 +++++++++++++++++--------------
 1 file changed, 50 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/bb287e20/python/cmake_modules/FindArrow.cmake
----------------------------------------------------------------------
diff --git a/python/cmake_modules/FindArrow.cmake b/python/cmake_modules/FindArrow.cmake
index 8e13dd6..fbe4545 100644
--- a/python/cmake_modules/FindArrow.cmake
+++ b/python/cmake_modules/FindArrow.cmake
@@ -25,68 +25,75 @@
 
 include(FindPkgConfig)
 
-set(ARROW_SEARCH_HEADER_PATHS
-  $ENV{ARROW_HOME}/include
-)
+if ("$ENV{ARROW_HOME}" STREQUAL "")
+  pkg_check_modules(ARROW arrow)
+  if (ARROW_FOUND)
+    pkg_get_variable(ARROW_ABI_VERSION arrow abi_version)
+    message(STATUS "Arrow ABI version: ${ARROW_ABI_VERSION}")
+    pkg_get_variable(ARROW_SO_VERSION arrow so_version)
+    message(STATUS "Arrow SO version: ${ARROW_SO_VERSION}")
+    set(ARROW_INCLUDE_DIR ${ARROW_INCLUDE_DIRS})
+    set(ARROW_LIBS ${ARROW_LIBRARY_DIRS})
+  endif()
+else()
+  set(ARROW_HOME "$ENV{ARROW_HOME}")
 
-set(ARROW_SEARCH_LIB_PATH
-  $ENV{ARROW_HOME}/lib
-)
+  set(ARROW_SEARCH_HEADER_PATHS
+    ${ARROW_HOME}/include
+    )
+
+  set(ARROW_SEARCH_LIB_PATH
+    ${ARROW_HOME}/lib
+    )
 
-pkg_check_modules(ARROW arrow)
-if (ARROW_FOUND)
-  pkg_get_variable(ARROW_ABI_VERSION arrow abi_version)
-  message(STATUS "Arrow ABI version: ${ARROW_ABI_VERSION}")
-  pkg_get_variable(ARROW_SO_VERSION arrow so_version)
-  message(STATUS "Arrow SO version: ${ARROW_SO_VERSION}")
-  set(ARROW_INCLUDE_DIR ${ARROW_INCLUDE_DIRS})
-  set(ARROW_LIBS ${ARROW_LIBRARY_DIRS})
-else()
   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
     PATHS
     ${ARROW_SEARCH_LIB_PATH}
     NO_DEFAULT_PATH)
   get_filename_component(ARROW_LIBS ${ARROW_LIB_PATH} DIRECTORY)
-endif()
 
-find_library(ARROW_JEMALLOC_LIB_PATH NAMES arrow_jemalloc
-  PATHS
-  ${ARROW_SEARCH_LIB_PATH}
-  NO_DEFAULT_PATH)
+  find_library(ARROW_JEMALLOC_LIB_PATH NAMES arrow_jemalloc
+    PATHS
+    ${ARROW_SEARCH_LIB_PATH}
+    NO_DEFAULT_PATH)
 
-find_library(ARROW_PYTHON_LIB_PATH NAMES arrow_python
-  PATHS
-  ${ARROW_SEARCH_LIB_PATH}
-  NO_DEFAULT_PATH)
+  find_library(ARROW_PYTHON_LIB_PATH NAMES arrow_python
+    PATHS
+    ${ARROW_SEARCH_LIB_PATH}
+    NO_DEFAULT_PATH)
 
-if (ARROW_INCLUDE_DIR AND ARROW_LIBS)
-  set(ARROW_FOUND TRUE)
+  if (ARROW_INCLUDE_DIR AND ARROW_LIBS)
+    set(ARROW_FOUND TRUE)
 
-  if (MSVC)
-    set(ARROW_STATIC_LIB ${ARROW_LIB_PATH})
-    set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH})
-    set(ARROW_JEMALLOC_STATIC_LIB ${ARROW_JEMALLOC_LIB_PATH})
-    set(ARROW_SHARED_LIB ${ARROW_STATIC_LIB})
-    set(ARROW_PYTHON_SHARED_LIB ${ARROW_PYTHON_STATIC_LIB})
-    set(ARROW_JEMALLOC_SHARED_LIB ${ARROW_JEMALLOC_STATIC_LIB})
-  else()
-    set(ARROW_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow.a)
-    set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow_python.a)
-    set(ARROW_JEMALLOC_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow_jemalloc.a)
+    if (MSVC)
+      set(ARROW_STATIC_LIB ${ARROW_LIB_PATH})
+      set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH})
+      set(ARROW_JEMALLOC_STATIC_LIB ${ARROW_JEMALLOC_LIB_PATH})
+      set(ARROW_SHARED_LIB ${ARROW_STATIC_LIB})
+      set(ARROW_PYTHON_SHARED_LIB ${ARROW_PYTHON_STATIC_LIB})
+      set(ARROW_JEMALLOC_SHARED_LIB ${ARROW_JEMALLOC_STATIC_LIB})
+    else()
+      set(ARROW_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow.a)
+      set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow_python.a)
+      set(ARROW_JEMALLOC_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/libarrow_jemalloc.a)
 
-    set(ARROW_SHARED_LIB ${ARROW_LIBS}/libarrow${CMAKE_SHARED_LIBRARY_SUFFIX})
-    set(ARROW_JEMALLOC_SHARED_LIB ${ARROW_LIBS}/libarrow_jemalloc${CMAKE_SHARED_LIBRARY_SUFFIX})
-    set(ARROW_PYTHON_SHARED_LIB ${ARROW_LIBS}/libarrow_python${CMAKE_SHARED_LIBRARY_SUFFIX})
+      set(ARROW_SHARED_LIB ${ARROW_LIBS}/libarrow${CMAKE_SHARED_LIBRARY_SUFFIX})
+      set(ARROW_JEMALLOC_SHARED_LIB ${ARROW_LIBS}/libarrow_jemalloc${CMAKE_SHARED_LIBRARY_SUFFIX})
+      set(ARROW_PYTHON_SHARED_LIB ${ARROW_LIBS}/libarrow_python${CMAKE_SHARED_LIBRARY_SUFFIX})
+    endif()
   endif()
+endif()
 
+if (ARROW_FOUND)
   if (NOT Arrow_FIND_QUIETLY)
     message(STATUS "Found the Arrow core library: ${ARROW_LIB_PATH}")
+    message(STATUS "Found the Arrow Python library: ${ARROW_PYTHON_LIB_PATH}")
     message(STATUS "Found the Arrow jemalloc library: ${ARROW_JEMALLOC_LIB_PATH}")
   endif ()
 else ()
@@ -105,9 +112,10 @@ endif ()
 
 mark_as_advanced(
   ARROW_INCLUDE_DIR
-  ARROW_LIBS
   ARROW_STATIC_LIB
   ARROW_SHARED_LIB
+  ARROW_PYTHON_STATIC_LIB
+  ARROW_PYTHON_SHARED_LIB
   ARROW_JEMALLOC_STATIC_LIB
   ARROW_JEMALLOC_SHARED_LIB
 )


Mime
View raw message