Skip to content

Commit

Permalink
Remove unnecessary find_packages and add ARROW_INSTALL_DIR options
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcd committed Aug 23, 2023
1 parent 6d76b2d commit 99621ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
9 changes: 2 additions & 7 deletions cpp/examples/tutorial_examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ project(ArrowTutorialExamples)
find_package(Arrow REQUIRED)

get_filename_component(ARROW_CONFIG_PATH ${Arrow_CONFIG} DIRECTORY)
find_package(Parquet REQUIRED HINTS ${ARROW_CONFIG_PATH})
find_package(ArrowAcero REQUIRED HINTS ${ARROW_CONFIG_PATH})
find_package(ArrowDataset REQUIRED HINTS ${ARROW_CONFIG_PATH})
find_package(ArrowDataset)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra")
Expand All @@ -45,7 +43,4 @@ add_executable(compute_example compute_example.cc)
target_link_libraries(compute_example PRIVATE Arrow::arrow_shared)

add_executable(dataset_example dataset_example.cc)
target_link_libraries(dataset_example
PRIVATE Arrow::arrow_shared Parquet::parquet_shared
ArrowAcero::arrow_acero_shared
ArrowDataset::arrow_dataset_shared)
target_link_libraries(dataset_example PRIVATE ArrowDataset::arrow_dataset_shared)
2 changes: 1 addition & 1 deletion cpp/examples/tutorial_examples/build_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -ex
mkdir -p $EXAMPLE_BUILD_DIR
pushd $EXAMPLE_BUILD_DIR

cmake /io
cmake /io $EXAMPLE_CMAKE_OPTIONS
make

popd
9 changes: 5 additions & 4 deletions cpp/examples/tutorial_examples/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,32 @@ cd /io

export ARROW_BUILD_DIR=/build/arrow
export EXAMPLE_BUILD_DIR=/build/example
export ARROW_INSTALL_DIR=/build/arrow-install

echo
echo "=="
echo "== Building Arrow C++ library"
echo "=="
echo

./build_arrow.sh
ARROW_CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${ARROW_INSTALL_DIR}" \
./build_arrow.sh

echo
echo "=="
echo "== Building example project using Arrow C++ library"
echo "=="
echo

./build_example.sh
EXAMPLE_CMAKE_OPTIONS="-DCMAKE_INSTALL_RPATH=${ARROW_INSTALL_DIR}/lib -DCMAKE_PREFIX_PATH=${ARROW_INSTALL_DIR}" \
./build_example.sh

echo
echo "=="
echo "== Running example project"
echo "=="
echo

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

${EXAMPLE_BUILD_DIR}/arrow_example
${EXAMPLE_BUILD_DIR}/compute_example
${EXAMPLE_BUILD_DIR}/file_access_example
Expand Down

0 comments on commit 99621ca

Please sign in to comment.