@@ -92,31 +92,34 @@ if(NOT TARGET ArrowAcero::arrow_acero_shared)
9292 )
9393endif ()
9494
95- if (NOT TARGET ArrowCompute::arrow_compute_shared)
96- # ArrowCompute::arrow_compute_shared is linked for no reason to parquet
97- # so we cannot use it because we do not want to build parquet itself.
98- # For that reason at the moment we need to do the lookup by hand.
99- get_target_property (ARROW_SHARED_LOCATION Arrow::arrow_shared LOCATION )
100- get_filename_component (ARROW_SHARED_DIR ${ARROW_SHARED_LOCATION} DIRECTORY )
101-
102- find_library (ARROW_COMPUTE_SHARED arrow_compute
103- PATHS ${ARROW_SHARED_DIR}
104- NO_DEFAULT_PATH
105- )
95+ string (REGEX MATCH "([0-9]+)\. *" ARROW_MAJOR "${ARROW_VERSION} " )
96+ if (${ARROW_MAJOR} GREATER 20)
97+ if (NOT TARGET ArrowCompute::arrow_compute_shared)
98+ # ArrowCompute::arrow_compute_shared is linked for no reason to parquet
99+ # so we cannot use it because we do not want to build parquet itself.
100+ # For that reason at the moment we need to do the lookup by hand.
101+ get_target_property (ARROW_SHARED_LOCATION Arrow::arrow_shared LOCATION )
102+ get_filename_component (ARROW_SHARED_DIR ${ARROW_SHARED_LOCATION} DIRECTORY )
103+
104+ find_library (ARROW_COMPUTE_SHARED arrow_compute
105+ PATHS ${ARROW_SHARED_DIR}
106+ NO_DEFAULT_PATH
107+ )
106108
107- if (ARROW_COMPUTE_SHARED)
108- message (STATUS
109- "Found arrow_compute_shared library at: ${ARROW_COMPUTE_SHARED} " )
110- else ()
111- message (FATAL_ERROR
112- "arrow_compute_shared library not found in ${ARROW_SHARED_DIR} " )
109+ if (ARROW_COMPUTE_SHARED)
110+ message (STATUS
111+ "Found arrow_compute_shared library at: ${ARROW_COMPUTE_SHARED} " )
112+ else ()
113+ message (FATAL_ERROR
114+ "arrow_compute_shared library not found in ${ARROW_SHARED_DIR} " )
115+ endif ()
116+
117+ # Step 3: Create a target for ArrowCompute::arrow_compute_shared
118+ add_library (ArrowCompute::arrow_compute_shared SHARED IMPORTED )
119+ set_target_properties (ArrowCompute::arrow_compute_shared PROPERTIES
120+ IMPORTED_LOCATION ${ARROW_COMPUTE_SHARED}
121+ )
113122 endif ()
114-
115- # Step 3: Create a target for ArrowCompute::arrow_compute_shared
116- add_library (ArrowCompute::arrow_compute_shared SHARED IMPORTED )
117- set_target_properties (ArrowCompute::arrow_compute_shared PROPERTIES
118- IMPORTED_LOCATION ${ARROW_COMPUTE_SHARED}
119- )
120123endif ()
121124
122125if (NOT TARGET Gandiva::gandiva_shared)
0 commit comments