File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,13 @@ function(build_arrow)
1616 list (APPEND arrow_CMAKE_ARGS -DARROW_JEMALLOC=OFF )
1717
1818 # transitive dependencies
19- list (APPEND arrow_INTERFACE_LINK_LIBRARIES thrift)
19+ if (thrift_VERSION VERSION_GREATER_EQUAL 0.17)
20+ # build arrow with system thrift, and include the transitive dependency on the Arrow::Arrow target
21+ list (APPEND arrow_INTERFACE_LINK_LIBRARIES thrift)
22+ else ()
23+ # build arrow with bundled thrift to work around missing boost dependency
24+ list (APPEND arrow_CMAKE_ARGS -DThrift_SOURCE=BUNDLED -DARROW_THRIFT_USE_SHARED=OFF )
25+ endif ()
2026
2127 if (NOT WITH_SYSTEM_UTF8PROC)
2228 # forward utf8proc_ROOT from build_utf8proc()
Original file line number Diff line number Diff line change @@ -17,9 +17,19 @@ find_library(
1717 HINTS ${thrift_HOME} ENV thrift_HOME /usr/local /opt/local
1818 PATH_SUFFIXES lib lib64)
1919
20+ if (thrift_INCLUDE_DIR)
21+ file (READ "${thrift_INCLUDE_DIR} /thrift/config.h" THRIFT_CONFIG_H_CONTENT)
22+ string (REGEX MATCH "#define PACKAGE_VERSION \" [0-9.]+\" " THRIFT_VERSION_DEFINITION
23+ "${THRIFT_CONFIG_H_CONTENT} " )
24+ string (REGEX MATCH "[0-9.]+" thrift_VERSION "${THRIFT_VERSION_DEFINITION} " )
25+ set (thrift_VERSION "${thrift_VERSION} " PARENT_SCOPE)
26+ endif ()
27+
2028include (FindPackageHandleStandardArgs)
21- find_package_handle_standard_args(thrift DEFAULT_MSG thrift_LIBRARIES
22- thrift_INCLUDE_DIR)
29+ find_package_handle_standard_args(
30+ thrift
31+ REQUIRED_VARS thrift_LIBRARIES thrift_INCLUDE_DIR
32+ VERSION_VAR thrift_VERSION)
2333mark_as_advanced (thrift_LIBRARIES thrift_INCLUDE_DIR)
2434
2535if (thrift_FOUND AND NOT (TARGET thrift::libthrift))
You can’t perform that action at this time.
0 commit comments