@@ -83,7 +83,7 @@ ExternalProject_Add (orc-format_ep
83
83
# ----------------------------------------------------------------------
84
84
# Snappy
85
85
86
- if (NOT "${SNAPPY_HOME} " STREQUAL "" )
86
+ if (NOT "${SNAPPY_HOME} " STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan" )
87
87
find_package (Snappy REQUIRED)
88
88
set (SNAPPY_VENDORED FALSE )
89
89
else ()
@@ -109,12 +109,18 @@ endif ()
109
109
110
110
add_library (orc_snappy INTERFACE )
111
111
add_library (orc::snappy ALIAS orc_snappy)
112
- if (ORC_PREFER_STATIC_SNAPPY AND ${SNAPPY_STATIC_LIB} )
112
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
113
+ target_link_libraries (orc_snappy INTERFACE ${Snappy_LIBRARIES} )
114
+ elseif (ORC_PREFER_STATIC_SNAPPY AND ${SNAPPY_STATIC_LIB} )
113
115
target_link_libraries (orc_snappy INTERFACE ${SNAPPY_STATIC_LIB} )
114
116
else ()
115
117
target_link_libraries (orc_snappy INTERFACE ${SNAPPY_LIBRARY} )
116
118
endif ()
117
- target_include_directories (orc_snappy SYSTEM INTERFACE ${SNAPPY_INCLUDE_DIR} )
119
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
120
+ target_include_directories (orc_snappy SYSTEM INTERFACE ${Snappy_INCLUDE_DIR} )
121
+ else ()
122
+ target_include_directories (orc_snappy SYSTEM INTERFACE ${SNAPPY_INCLUDE_DIR} )
123
+ endif ()
118
124
119
125
if (SNAPPY_VENDORED)
120
126
add_dependencies (orc_snappy snappy_ep)
@@ -127,7 +133,7 @@ endif ()
127
133
# ----------------------------------------------------------------------
128
134
# ZLIB
129
135
130
- if (NOT "${ZLIB_HOME} " STREQUAL "" )
136
+ if (NOT "${ZLIB_HOME} " STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan" )
131
137
find_package (ZLIB REQUIRED)
132
138
set (ZLIB_VENDORED FALSE )
133
139
else ()
@@ -161,7 +167,9 @@ endif ()
161
167
162
168
add_library (orc_zlib INTERFACE )
163
169
add_library (orc::zlib ALIAS orc_zlib)
164
- if (ORC_PREFER_STATIC_ZLIB AND ${ZLIB_STATIC_LIB} )
170
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
171
+ target_link_libraries (orc_zlib INTERFACE ${ZLIB_LIBRARIES} )
172
+ elseif (ORC_PREFER_STATIC_ZLIB AND ${ZLIB_STATIC_LIB} )
165
173
target_link_libraries (orc_zlib INTERFACE ${ZLIB_STATIC_LIB} )
166
174
else ()
167
175
target_link_libraries (orc_zlib INTERFACE ${ZLIB_LIBRARY} )
@@ -179,7 +187,7 @@ endif ()
179
187
# ----------------------------------------------------------------------
180
188
# Zstd
181
189
182
- if (NOT "${ZSTD_HOME} " STREQUAL "" )
190
+ if (NOT "${ZSTD_HOME} " STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan" )
183
191
find_package (ZSTD REQUIRED)
184
192
set (ZSTD_VENDORED FALSE )
185
193
else ()
@@ -220,12 +228,18 @@ endif ()
220
228
221
229
add_library (orc_zstd INTERFACE )
222
230
add_library (orc::zstd ALIAS orc_zstd)
223
- if (ORC_PREFER_STATIC_ZSTD AND ${ZSTD_STATIC_LIB} )
231
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
232
+ target_link_libraries (orc_zstd INTERFACE ${zstd_LIBRARIES} )
233
+ elseif (ORC_PREFER_STATIC_ZSTD AND ${ZSTD_STATIC_LIB} )
224
234
target_link_libraries (orc_zstd INTERFACE ${ZSTD_STATIC_LIB} )
225
235
else ()
226
236
target_link_libraries (orc_zstd INTERFACE ${ZSTD_LIBRARY} )
227
237
endif ()
228
- target_include_directories (orc_zstd SYSTEM INTERFACE ${ZSTD_INCLUDE_DIR} )
238
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
239
+ target_include_directories (orc_zstd SYSTEM INTERFACE ${zstd_INCLUDE_DIR} )
240
+ else ()
241
+ target_include_directories (orc_zstd SYSTEM INTERFACE ${ZSTD_INCLUDE_DIR} )
242
+ endif ()
229
243
230
244
if (ZSTD_VENDORED)
231
245
add_dependencies (orc_zstd zstd_ep)
@@ -238,7 +252,7 @@ endif ()
238
252
# ----------------------------------------------------------------------
239
253
# LZ4
240
254
241
- if (NOT "${LZ4_HOME} " STREQUAL "" )
255
+ if (NOT "${LZ4_HOME} " STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan" )
242
256
find_package (LZ4 REQUIRED)
243
257
set (LZ4_VENDORED FALSE )
244
258
else ()
@@ -272,12 +286,18 @@ endif ()
272
286
273
287
add_library (orc_lz4 INTERFACE )
274
288
add_library (orc::lz4 ALIAS orc_lz4)
275
- if (ORC_PREFER_STATIC_LZ4 AND ${LZ4_STATIC_LIB} )
289
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
290
+ target_link_libraries (orc_lz4 INTERFACE ${lz4_LIBRARIES} )
291
+ elseif (ORC_PREFER_STATIC_LZ4 AND ${LZ4_STATIC_LIB} )
276
292
target_link_libraries (orc_lz4 INTERFACE ${LZ4_STATIC_LIB} )
277
293
else ()
278
294
target_link_libraries (orc_lz4 INTERFACE ${LZ4_LIBRARY} )
279
295
endif ()
280
- target_include_directories (orc_lz4 SYSTEM INTERFACE ${LZ4_INCLUDE_DIR} )
296
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
297
+ target_include_directories (orc_lz4 SYSTEM INTERFACE ${lz4_INCLUDE_DIR} )
298
+ else ()
299
+ target_include_directories (orc_lz4 SYSTEM INTERFACE ${LZ4_INCLUDE_DIR} )
300
+ endif ()
281
301
282
302
if (LZ4_VENDORED)
283
303
add_dependencies (orc_lz4 lz4_ep)
@@ -393,7 +413,7 @@ endif ()
393
413
# ----------------------------------------------------------------------
394
414
# Protobuf
395
415
396
- if (NOT "${PROTOBUF_HOME} " STREQUAL "" )
416
+ if (NOT "${PROTOBUF_HOME} " STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan" )
397
417
find_package (Protobuf REQUIRED)
398
418
set (PROTOBUF_VENDORED FALSE )
399
419
else ()
@@ -442,14 +462,23 @@ add_library (orc::protobuf ALIAS orc_protobuf)
442
462
add_library (orc_protoc INTERFACE )
443
463
add_library (orc::protoc ALIAS orc_protoc)
444
464
445
- if (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOBUF_STATIC_LIB} )
465
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
466
+ target_link_libraries (orc_protobuf INTERFACE ${protobuf_LIBRARIES} )
467
+ elseif (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOBUF_STATIC_LIB} )
446
468
target_link_libraries (orc_protobuf INTERFACE ${PROTOBUF_STATIC_LIB} )
447
469
else ()
448
470
target_link_libraries (orc_protobuf INTERFACE ${PROTOBUF_LIBRARY} )
449
471
endif ()
450
- target_include_directories (orc_protobuf SYSTEM INTERFACE ${PROTOBUF_INCLUDE_DIR} )
472
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
473
+ target_include_directories (orc_protobuf SYSTEM INTERFACE ${protobuf_INCLUDE_DIR} )
474
+ else ()
475
+ target_include_directories (orc_protobuf SYSTEM INTERFACE ${PROTOBUF_INCLUDE_DIR} )
476
+ endif ()
451
477
452
- if (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOC_STATIC_LIB} )
478
+ if (ORC_PACKAGE_KIND STREQUAL "conan" )
479
+ cmake_path(GET protobuf_INCLUDE_DIR PARENT_PATH PROTOBUF_HOME)
480
+ set (PROTOBUF_EXECUTABLE ${PROTOBUF_HOME} /bin/protoc)
481
+ elseif (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOC_STATIC_LIB} )
453
482
target_link_libraries (orc_protoc INTERFACE ${PROTOC_STATIC_LIB} )
454
483
else ()
455
484
target_link_libraries (orc_protoc INTERFACE ${PROTOC_LIBRARY} )
0 commit comments