Skip to content

Commit f6fd1b2

Browse files
committed
fix for missing target in arrow 20
1 parent b57ebf1 commit f6fd1b2

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

Framework/Core/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# In applying this license CERN does not waive the privileges and immunities
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
11-
1211
o2_add_library(Framework
1312
SOURCES src/AnalysisHelpers.cxx
1413
src/AlgorithmSpec.cxx
@@ -178,7 +177,7 @@ o2_add_library(Framework
178177
RapidJSON::RapidJSON
179178
Arrow::arrow_shared
180179
ArrowDataset::arrow_dataset_shared
181-
ArrowCompute::arrow_compute_shared
180+
$<$<TARGET_EXISTS:ArrowCompute::arrow_compute_shared>:ArrowCompute::arrow_compute_shared>
182181
Microsoft.GSL::GSL
183182
O2::FrameworkLogger
184183
Gandiva::gandiva_shared

dependencies/O2Dependencies.cmake

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -92,31 +92,34 @@ if(NOT TARGET ArrowAcero::arrow_acero_shared)
9292
)
9393
endif()
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-
)
120123
endif()
121124

122125
if(NOT TARGET Gandiva::gandiva_shared)

0 commit comments

Comments
 (0)