kevingurney commented on a change in pull request #10614:
URL: https://github.com/apache/arrow/pull/10614#discussion_r660656255



##########
File path: matlab/CMakeLists.txt
##########
@@ -17,6 +17,23 @@
 
 cmake_minimum_required(VERSION 3.20)
 
+# This function uses the ThirdpartyToolchain CMake module
+# in cpp/cmake_modules to automatically download and build GoogleTest.
+function(download_and_build_google_test)
+  # The ExternalProject module is required for downloading and building 
external dependencies.
+  include(ExternalProject)
+  # The ThirdpartyToolchain module automatically builds xsimd by default,
+  # so we explicitly disable building of xsimd here.
+  set(ARROW_SIMD_LEVEL "NONE")
+  set(ARROW_RUNTIME_SIMD_LEVEL "NONE")
+  # The ThirdpartyToolchain module must know the location of the Arrow C++ 
libraries source code.
+  set(arrow_SOURCE_DIR ${CMAKE_SOURCE_DIR}/../cpp)
+  # The ThirdpartyToolchain module uses ExternalProject to download GoogleTest.
+  include(ThirdpartyToolchain)

Review comment:
       Thanks for reviewing these changes, @kou!
   
   Could you elaborate on why `ThirdpartyToolchain` isn't expected to be 
`include`d in other CMake files?
   
   We intentionally wanted to reuse the robust infrastructure that the 
community took time to develop for finding 3rd party libraries in a flexible 
way, rather than reinventing the wheel here.




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