Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-4930: [C++] Improve find_package() support
Backward incompatibilities: * find_package(Arrow) doesn't find Arrow Python. Users need to use find_package(ArrowPython). * find_package(ArrowCuda) doesn't work on not Windows (case sensitive environments). Use find_package(ArrowCUDA) instead. Summary: * Create arrow_find_package() in FindArrow.cmake and use it in Find*.cmake. * arrow_find_package() is a function that finds an Arrow related package. It supports ARROW_HOME/PARQUET_HOME environment variable, CMake package configuration and pkg-config. * arrow_find_package() can find libraries installed under lib/x86_64-linux-gnu/ (on Debian), lib64/ (on CentOS), lib/, bin/ (on Windows). * We can remove workaround for ARROW-1090 in python/setup.py: https://issues.apache.org/jira/projects/ARROW/issues/ARROW-1090 * Create Find*.cmake per component. It means that FindArrow.cmake doesn't find Arrow Python. Use find_package(ArrowPython) instead of find_package(Arrow). * Install Find*.cmake to be reusable. * Changes for Linux packages are for this. * Rename arrowConfig.cmake, arrowTarget.cmake and so on to ArrowConfig.cmake, ArrowTarget.cmake and so on to use the same package for FindArrow.cmake. arrow-config.cmake is added for backward compatibility. So users can use find_package(arrow) instead of find_package(Arrow). * ArrowConfig.cmake provides more useful variables such as ARROW_SO_VERSION and ARROW_FULL_SO_VERSION. * Rename FindArrowCuda.cmake to FindArrowCUDA.cmake because "CUDA" is the official name. * Use find_package_handle_standard_args() in Find*.cmake. It means that we can check required version by find_package(Arrow 0.15.0). * Changes for Parquet are for detecting Parquet version. * Use consistent variable names in Find*.cmake with keeping backward compatibility: * ${PACKAGE}_LIBS -> ${PACKAGE}_LIB_DIR: Because we use ${ARROW_INCLUDE_DIR} and CMake uses _DIR, _DIRECTORY, _PATH and so on. * ${PACKAGE}_SHARED_IMP_LIB -> ${PACKAGE}_IMPORT_LIB: Because CMake doesn't use SHARED for import library such as CMAKE_IMPORT_LIBRARY_SUFFIX. * Find*.cmake provides CMake targets such as arrow_shared and arrow_static even if it uses ARROW_HOME or pkg-config. Users can use them to link to Arrow. * Remove needless ABI_VERSION handling in python/CMakeLists.txt because ABI_VERSION just exists just for backward compatibility. We should use only SO_VERSION. * Rename "executable" to "plasma_store_server" in plasma.pc. "executable" is deprecated. * Add arrow-python-flight.pc. Resolved issues: * ARROW-5021 [C++] Review hardcoded "lib" paths in Find$PACKAGE.cmake related to endogenous libraries https://issues.apache.org/jira/browse/ARROW-5021 Removed workarounds: * ARROW-1090 [Python] build_ext usability https://issues.apache.org/jira/projects/ARROW/issues/ARROW-1090 * ARROW-5025 [Python][Packaging] wheel for Windows are broken https://issues.apache.org/jira/browse/ARROW-5025 * ARROW-5026 [Python][Packaging] conda package on non Windows is broken https://issues.apache.org/jira/browse/ARROW-5026 Closes apache#5767 from kou/cpp-fix-discovery and squashes the following commits: 175fa0f <Sutou Kouhei> Add comments for shared library paths manipulation in pkg-config mode 62fef66 <Sutou Kouhei> Add comments to internal functions and macros 81b9daa <Sutou Kouhei> SHARED_IMPLIB -> IMPORT_LIB 00fe010 <Sutou Kouhei> Don't reset defined ARROW_MSVC_STATIC_LIB_SUFFIX a2adff0 <Sutou Kouhei> Fix a typo 67665eb <Sutou Kouhei> Add a comment why we can't load targets multiple times 070c5d5 <Sutou Kouhei> Always load options aea7801 <Sutou Kouhei> Update variable name 5c4634f <Sutou Kouhei> Use absolute path instead of library name d7a94dd <Sutou Kouhei> Add missing _path 4da45f7 <Sutou Kouhei> Format 0f352f1 <Sutou Kouhei> Fix a typo ef152c4 <Sutou Kouhei> Add missing libarrow-python-flight 20b98d9 <Sutou Kouhei> Add missing arrow-python-flight.pc 53d1508 <Sutou Kouhei> Install Find*.cmake only for enabled modules 1b41a1f <Sutou Kouhei> ARROW-4930: Improve find_package() support Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
- Loading branch information