raulcd commented on code in PR #48250:
URL: https://github.com/apache/arrow/pull/48250#discussion_r2577977082


##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -2852,52 +2852,24 @@ function(build_re2)
   set(RE2_VENDORED
       TRUE
       PARENT_SCOPE)
-  set(RE2_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/re2_fc-install")
-  set(RE2_PREFIX
-      "${RE2_PREFIX}"
-      PARENT_SCOPE)
 
   fetchcontent_declare(re2
                        URL ${RE2_SOURCE_URL}
-                       URL_HASH "SHA256=${ARROW_RE2_BUILD_SHA256_CHECKSUM}")
+                       URL_HASH "SHA256=${ARROW_RE2_BUILD_SHA256_CHECKSUM}"
+                       EXCLUDE_FROM_ALL)
   prepare_fetchcontent()
 
   # Unity build causes some build errors
   set(CMAKE_UNITY_BUILD OFF)
-  fetchcontent_makeavailable(re2)
-
-  # This custom target ensures re2 is built before we install
-  add_custom_target(re2_built DEPENDS re2::re2)
-
-  add_custom_command(OUTPUT "${re2_BINARY_DIR}/cmake_install.cmake.saved"
-                     COMMAND ${CMAKE_COMMAND} -E copy_if_different
-                             "${re2_BINARY_DIR}/cmake_install.cmake"
-                             "${re2_BINARY_DIR}/cmake_install.cmake.saved"
-                     COMMAND ${CMAKE_COMMAND} -E echo
-                             "# RE2 install disabled to prevent double 
installation with Arrow"
-                             > "${re2_BINARY_DIR}/cmake_install.cmake"
-                     DEPENDS re2_built
-                     COMMENT "Disabling RE2 install to prevent double 
installation"
-                     VERBATIM)
 
-  add_custom_target(re2_install_disabled ALL
-                    DEPENDS "${re2_BINARY_DIR}/cmake_install.cmake.saved")
+  # Disable install rules for RE2 so it is not installed on our Linux-packages.
+  set(CMAKE_SKIP_INSTALL_RULES ON)

Review Comment:
   Thanks @kou I completely missed how we were doing it on the others like 
Thrift or Azure. I agree with you, your proposed approach is much better than 
what I did. I validated it works. I've done the same for gRPC thanks!!



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