Combining the brew installed apache-arrow in cmake that uses. vcpkg chaintool

  apache-arrow, c++, cmake, vcpkg

Here is a cmake snippet that I use to link to libpqxx library that is installed by vcpkg and try to use the apache-arrow that is installed by brew.

find_package(libpqxx REQUIRED)
target_link_libraries(database PRIVATE libpqxx::pqxx)

find_package(Arrow CONFIG REQUIRED PATHS /usr/local/lib/cmake/arrow NO_DEFAULT_PATH)
find_package(Parquet CONFIG REQUIRED PATHS /usr/local/lib/cmake/arrow NO_DEFAULT_PATH)
target_link_libraries(database PRIVATE arrow_shared parquet_shared)

To run it I use:
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=/Users/amir/projects/github-code/vcpkg/scripts/buildsystems/vcpkg.cmake

I get the following error:

CMake Error at /usr/local/Cellar/cmake/3.20.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Brotli (missing: BROTLI_COMMON_LIBRARY BROTLI_ENC_LIBRARY
  BROTLI_DEC_LIBRARY)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.20.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/lib/cmake/arrow/FindBrotli.cmake:113 (find_package_handle_standard_args)
  /Users/amir/projects/github-code/vcpkg/scripts/buildsystems/vcpkg.cmake:772 (_find_package)
  /usr/local/Cellar/cmake/3.20.3/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /usr/local/lib/cmake/arrow/ArrowConfig.cmake:86 (find_dependency)
  /Users/amir/projects/github-code/vcpkg/scripts/buildsystems/vcpkg.cmake:772 (_find_package)
  CMakeLists.txt:76 (find_package)

Source: Windows Questions C++

LEAVE A COMMENT