jorisvandenbossche commented on code in PR #41494:
URL: https://github.com/apache/arrow/pull/41494#discussion_r1589115180


##########
python/CMakeLists.txt:
##########
@@ -265,11 +246,77 @@ message(STATUS "NumPy include dir: ${NUMPY_INCLUDE_DIRS}")
 
 include(UseCython)
 
-# PyArrow C++
+# Arrow C++ and set default PyArrow build options
 include(GNUInstallDirs)
-
 find_package(Arrow REQUIRED)
 
+macro(define_option name description arrow_option)
+  set("PYARROW_${name}"
+      "AUTO"
+      CACHE STRING ${description})
+
+  if("${PYARROW_${name}}" STREQUAL "AUTO")
+    # by default, first check if env variable exists, otherwise use Arrow C++ 
config
+    set(env_variable "PYARROW_WITH_${name}")
+    if(DEFINED ENV{${env_variable}})
+      message(STATUS "Env variable is defined: 
${env_variable}=$ENV{${env_variable}}")
+      if($ENV{${env_variable}})
+        set("PYARROW_BUILD_${name}" ON)
+        message(STATUS "Setting ${name} to ON through env variable")
+      else()
+        set("PYARROW_BUILD_${name}" OFF)
+        message(STATUS "Setting ${name} to OFF through env variable")

Review Comment:
   I made this quite verbose, mostly for testing / debugging purposes. But can 
trim most of the messages after everything is working if that is preferred.



-- 
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-unsubscr...@arrow.apache.org

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

Reply via email to