felipecrv commented on code in PR #43219:
URL: https://github.com/apache/arrow/pull/43219#discussion_r1674747070


##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -249,6 +249,23 @@ function(provide_find_module PACKAGE_NAME 
ARROW_CMAKE_PACKAGE_NAME)
   provide_cmake_module("Find${PACKAGE_NAME}" ${ARROW_CMAKE_PACKAGE_NAME})
 endfunction()
 
+# Compare the version numbers of a package. Must call after a find_package()
+# call because version of package is accessed by ${${PACKAGE_NAME}_VERSION}.
+#
+# COMPATIBLE_VAR is set to the boolean value of
+# ${${PACKAGE_NAME}_VERSION} >= ${REQUIRED_VERSION}.
+function(compare_version PACKAGE_NAME REQUIRED_VERSION COMPATIBLE_VAR)
+  if(${${PACKAGE_NAME}_VERSION} VERSION_LESS ${REQUIRED_VERSION})
+    set(${COMPATIBLE_VAR}
+        FALSE
+        PARENT_SCOPE)
+  else()
+    set(${COMPATIBLE_VAR}
+        TRUE
+        PARENT_SCOPE)
+  endif()
+endfunction()

Review Comment:
   Sorry. I mistakenly included a commit in the push that I didn't mean to.
   
   > Why do you want to extract this?
   
   It was going to be an intermediate step to allow custom version comparison 
logic, but it turned out to be unnecessary and so is this commit as well.



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