cmake: move Arrow targets into find_package modules

Signed-off-by: Casey <cbodley@redhat.com>
This commit is contained in:
Casey 2022-02-04 13:02:52 -08:00 committed by Casey Bodley
parent 433782dbd5
commit 5da406a4ee
3 changed files with 24 additions and 13 deletions

View File

@ -32,6 +32,9 @@
# ARROW_VERSION_MINOR, minor version of found Arrow
# ARROW_VERSION_PATCH, patch version of found Arrow
# cbodley copied this from the arrow submodule at v6.0.1
# cbodley added the import target Arrow::Arrow to match build_arrow()
if(DEFINED ARROW_FOUND)
return()
endif()
@ -464,3 +467,11 @@ if(Arrow_FOUND AND NOT Arrow_FIND_QUIETLY)
message(STATUS "Found the Arrow core import library: ${ARROW_IMPORT_LIB}")
message(STATUS "Found the Arrow core static library: ${ARROW_STATIC_LIB}")
endif()
if(Arrow_FOUND AND NOT TARGET Arrow::Arrow)
add_library(Arrow::Arrow SHARED IMPORTED)
set_target_properties(Arrow::Arrow PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ARROW_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${ARROW_SHARED_LIB}")
endif()

View File

@ -31,6 +31,9 @@
# PARQUET_SO_VERSION, shared object version of found Parquet such as "100"
# PARQUET_STATIC_LIB, path to libparquet.a
# cbodley copied this from the arrow submodule at v6.0.1
# cbodley added the import target Arrow::Parquet to match build_arrow()
if(DEFINED PARQUET_FOUND)
return()
endif()
@ -124,3 +127,11 @@ if(Parquet_FOUND AND NOT Parquet_FIND_QUIETLY)
message(STATUS "Found the Parquet import library: ${PARQUET_IMPORT_LIB}")
message(STATUS "Found the Parquet static library: ${PARQUET_STATIC_LIB}")
endif()
if(Parquet_FOUND AND NOT TARGET Arrow::Parquet)
add_library(Arrow::Parquet SHARED IMPORTED)
set_target_properties(Arrow::Parquet PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PARQUET_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${PARQUET_SHARED_LIB}")
endif()

View File

@ -868,19 +868,8 @@ endif(WITH_KVS)
if(WITH_RADOSGW)
if(WITH_RADOSGW_SELECT_PARQUET)
if(WITH_SYSTEM_ARROW)
find_package(Arrow REQUIRED)
find_package(Parquet REQUIRED)
add_library(Arrow::Arrow SHARED IMPORTED)
set_target_properties(Arrow::Arrow PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${ARROW_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${ARROW_SHARED_LIB}")
add_library(Arrow::Parquet SHARED IMPORTED)
set_target_properties(Arrow::Parquet PROPERTIES
INTERFACE_LINK_LIBRARIES Arrow::Arrow
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${PARQUET_SHARED_LIB}")
find_package(Arrow 4 REQUIRED QUIET)
find_package(Parquet 4 REQUIRED QUIET)
else()
# find arrow's dependencies
if (WITH_SYSTEM_UTF8PROC)