You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/27 08:15:58 UTC

[GitHub] [arrow] AlenkaF commented on a diff in pull request #13311: ARROW-16340: [Python] Move all Python related code into PyArrow

AlenkaF commented on code in PR #13311:
URL: https://github.com/apache/arrow/pull/13311#discussion_r907102453


##########
python/pyarrow/src_arrow/CMakeLists.txt:
##########
@@ -19,8 +19,45 @@
 # arrow_python
 #
 
+cmake_minimum_required(VERSION 3.5)
+
+# RPATH settings on macOS do not affect install_name.
+# https://cmake.org/cmake/help/latest/policy/CMP0068.html
+if(POLICY CMP0068)
+  cmake_policy(SET CMP0068 NEW)
+endif()
+
+# Define
+# ARROW_SOURCE_DIR: location of arrow/cpp
+# CMAKE_MODULE_PATH: location of cmake_modules in python
+get_filename_component(PYARROW_SOURCE_DIR ${CMAKE_SOURCE_DIR} DIRECTORY)
+get_filename_component(PYTHON_SOURCE_DIR ${PYARROW_SOURCE_DIR} DIRECTORY)
+get_filename_component(ARROW_SOURCE ${PYTHON_SOURCE_DIR} DIRECTORY)
+set(ARROW_SOURCE_DIR "${ARROW_SOURCE}/cpp")
+# Add cmake_modules and lib/cmake/arrow folder to CMAKE_MODULE_PATH
+# TODO: remove lib/cmake/arrow folder as it should not be necessary as find_package(Arrow)
+# should load all the cmake variables (ex ARROW_DATASET)
+set(CMAKE_MODULE_PATH "${PYTHON_SOURCE_DIR}/cmake_modules" "${ARROW_SOURCE}/dist/lib/cmake/arrow")
+message(STATUS "CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}")
+
+set(ARROW_PYTHON_VERSION "9.0.0-SNAPSHOT")
+string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" ARROW_PYTHON_BASE_VERSION "${ARROW_PYTHON_VERSION}")
+# Need to set to ARRROW_VERSION before finding Arrow package!
+project(arrow_python VERSION "${ARROW_PYTHON_BASE_VERSION}")
+
+if(NOT DEFINED CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE Release)
+endif()
+
+find_package(Arrow REQUIRED)
+# Loading ArrowOptions, they should be loaded by default with find_package(Arrow REQUIRED)
+include(ArrowOptions)

Review Comment:
   I had to include `ArrowOptions` separately but I think they should be found with `find_package(Arrow REQUIRED)`. The CI now fails as the search for `ArrowOptions` only works for me locally.
   
   @kou any tips on how to help cmake find ArrowOptions?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org