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


##########
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:
   Could you set `CMAKE_PREFPX_PATH=/opt/conda/envs/arrow` environment variable 
(not CMake variable)? Then `find_package(Arrow REQUIRED)` loads `ArrowOptions` 
too. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to