diff --git a/cpp/examples/tutorial_examples/CMakeLists.txt b/cpp/examples/tutorial_examples/CMakeLists.txt index 7758af90fb2a2..8788501484c87 100644 --- a/cpp/examples/tutorial_examples/CMakeLists.txt +++ b/cpp/examples/tutorial_examples/CMakeLists.txt @@ -19,11 +19,7 @@ cmake_minimum_required(VERSION 3.16) 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(ArrowDataset REQUIRED HINTS ${ARROW_CONFIG_PATH}) +find_package(ArrowDataset) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra") @@ -44,5 +40,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 - ArrowDataset::arrow_dataset_shared) +target_link_libraries(dataset_example PRIVATE ArrowDataset::arrow_dataset_shared) diff --git a/cpp/examples/tutorial_examples/build_example.sh b/cpp/examples/tutorial_examples/build_example.sh index a315755a597f5..0b279890a78e4 100755 --- a/cpp/examples/tutorial_examples/build_example.sh +++ b/cpp/examples/tutorial_examples/build_example.sh @@ -21,7 +21,7 @@ set -ex mkdir -p $EXAMPLE_BUILD_DIR pushd $EXAMPLE_BUILD_DIR -cmake /io +cmake /io $EXAMPLE_CMAKE_OPTIONS make popd diff --git a/cpp/examples/tutorial_examples/dataset_example.cc b/cpp/examples/tutorial_examples/dataset_example.cc index 005cdc324d057..a980fa54939c5 100644 --- a/cpp/examples/tutorial_examples/dataset_example.cc +++ b/cpp/examples/tutorial_examples/dataset_example.cc @@ -25,6 +25,7 @@ #include #include +#include #include // (Doc section: Includes) diff --git a/cpp/examples/tutorial_examples/run.sh b/cpp/examples/tutorial_examples/run.sh index ed319a9d327ec..bc0078435cc47 100755 --- a/cpp/examples/tutorial_examples/run.sh +++ b/cpp/examples/tutorial_examples/run.sh @@ -22,6 +22,7 @@ cd /io export ARROW_BUILD_DIR=/build/arrow export EXAMPLE_BUILD_DIR=/build/example +export ARROW_INSTALL_DIR=/build/arrow-install echo echo "==" @@ -29,7 +30,9 @@ echo "== Building Arrow C++ library" echo "==" echo -./build_arrow.sh +ARROW_CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${ARROW_INSTALL_DIR} \ + -DCMAKE_INSTALL_RPATH=${ARROW_INSTALL_DIR}/lib" \ + ./build_arrow.sh echo echo "==" @@ -37,7 +40,9 @@ 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 "==" diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index bad5b3c1f8988..2e5ccbba56f77 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -1625,7 +1625,7 @@ tasks: run: {{ kind }} {% endfor %} - cpp-tutorial-example: + example-cpp-tutorial: ci: github template: cpp-examples/github.linux.yml params: