Hi all,

I am trying to use cmake find_package in my project (inside a conda env). I
have the following in the cmake file.

    message("Finding Arrow from SYSTEM")
    find_package(Arrow ${CYLON_ARROW_VERSION} CONFIG REQUIRED)
    message(STATUS "Arrow found: ${ARROW_FOUND}")
    message(STATUS "Arrow ver: ${ARROW_FULL_SO_VERSION}")
    message(STATUS "Arrow include dir: ${ARROW_INCLUDE_DIR}")
    message(STATUS "Arrow lib dir: ${ARROW_LIB_DIR}")

    find_library(ARROW_SO arrow ${CYLON_ARROW_VERSION})
    message(STATUS "Arrow lib: ${ARROW_SO}")

    find_library(ARROW_PY_SO arrow_python ${CYLON_ARROW_VERSION})
    message(STATUS "Arrow py lib: ${ARROW_PY_SO}")

Following is my output.

Finding Arrow from SYSTEM
-- Arrow found:
-- Arrow ver: 400.1.0
-- Arrow include dir:
-- Arrow lib dir:
-- Arrow lib: /aux/miniconda/envs/cylon_dev/lib/libarrow.so
-- Arrow py lib: /aux/miniconda/envs/cylon_dev/lib/libarrow_python.so

It seems to be that the CMake variables like, ARROW_FOUND,
ARROW_INCLUDE_DIR, etc are not set properly. But cmake can still locate the
.so files without a problem.

When I explicitly call the FindArrow.cmake file in the
${CONDA_PREFIX}/lib/cmake/arrow dir,
find_package(Arrow CONFIG REQUIRED CONFIGS FindArrow.cmake HINTS
${CONDA_PREFIX}/lib/cmake/arrow)

I get the following cmake warning, but then all variables are set properly.
Finding Arrow from SYSTEM
CMake Warning (dev) at
/aux/miniconda/envs/cylon_dev/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:438
(message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (Arrow).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):

/aux/miniconda/envs/cylon_dev/share/cmake-3.21/Modules/FindPkgConfig.cmake:70
(find_package_handle_standard_args)
  /aux/miniconda/envs/cylon_dev/lib/cmake/arrow/FindArrow.cmake:39 (include)
  CMakeLists.txt:243 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Arrow version: 4.0.1 (CMake package configuration: Arrow)
-- Arrow SO and ABI version: 400
-- Arrow full SO version: 400.1.0
-- Found the Arrow core shared library:
/aux/miniconda/envs/cylon_dev/lib/libarrow.so
-- Found the Arrow core import library:
-- Found the Arrow core static library:
-- Arrow found: TRUE
-- Arrow ver: 400.1.0
-- Arrow include dir: /aux/miniconda/envs/cylon_dev/include
-- Arrow lib dir: /aux/miniconda/envs/cylon_dev/lib
-- Arrow lib: /aux/miniconda/envs/cylon_dev/lib/libarrow.so
-- Arrow py lib: /aux/miniconda/envs/cylon_dev/lib/libarrow_python.so

When we are using Arrow in an external project, should I copy the
FindArrow.cmake file to that project explicitly, and then use it?

https://github.com/apache/arrow/blob/master/cpp/cmake_modules/FindArrow.cmake
-- 
Niranda Perera
https://niranda.dev/
@n1r44 <https://twitter.com/N1R44>

Reply via email to