kevingurney commented on code in PR #34563:
URL: https://github.com/apache/arrow/pull/34563#discussion_r1171700533


##########
matlab/CMakeLists.txt:
##########
@@ -32,8 +32,13 @@ function(build_arrow)
     message(SEND_ERROR "Error: unrecognized arguments: 
${ARG_UNPARSED_ARGUMENTS}")
   endif()
 
-  # If Arrow needs to be built, the default location will be within the build 
tree.
-  set(ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
+  # If Arrow build available, set ARROW_PREFIX to the ARROW_HOME specified 
with cmake.
+  if(Arrow_FOUND)
+    set(ARROW_PREFIX "${ARROW_HOME}")
+  else()
+    # If Arrow needs to be built, the default location will be within the 
build tree.
+    set(ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep-prefix")
+  endif()

Review Comment:
   This is a good point. We probably don't need to be setting all of these 
properties on the `arrow_shared_for_gtest` target if we aren't going to end up 
actually using the `arrow_shared_for_gtest` target in the end.
   
   I took a first pass at refactoring this.
   
   Eventually, it would probably make sense to stop using this "bundled 
GoogleTest" approach because it adds quite a bit of complexity to the build 
system. I think it would be preferable if we used `FetchContent` to build 
GoogleTest from upstream source when an existing GoogleTest installation isn't 
found by `find_package(GTest)`.
   
   Marking this as resolved.



-- 
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