Kouhei Sutou created ARROW-4383: ----------------------------------- Summary: [C++] Use the CMake's standard find features Key: ARROW-4383 URL: https://issues.apache.org/jira/browse/ARROW-4383 Project: Apache Arrow Issue Type: Improvement Components: C++ Reporter: Kouhei Sutou
>From https://github.com/apache/arrow/pull/3469#discussion_r250862542 We implement our custom find codes to find libraries by {{find_library()}}/{{find_path()}} with {{NO_DEFAULT_PATH}}. So we need to handle {{lib64/}} (on Red Hat) and {{lib/x86_64-linux-gnu/}} (on Debian) paths manually. If we use the CMake's standard find features such as {{CMAKE_PREFIX_PATH}} https://cmake.org/cmake/help/v3.13/variable/CMAKE_PREFIX_PATH.html#variable:CMAKE_PREFIX_PATH , we can remove our custom find codes. CMake has package specific find path feature by {{<PackageName}_ROOT}} since 3.12. It's equivalent of our {{<PackageName}_HOME}}. https://cmake.org/cmake/help/v3.12/command/find_library.html {quote} If called from within a find module loaded by {{find_package(<PackageName>)}}, search prefixes unique to the current package being found. Specifically look in the {{<PackageName>_ROOT}} CMake variable and the {{<PackageName>_ROOT}} environment variable. The package root variables are maintained as a stack so if called from nested find modules, root paths from the parent’s find module will be searched after paths from the current module, i.e. {{<CurrentPackage>_ROOT}}, {{ENV\{<CurrentPackage>_ROOT}}}, {{<ParentPackage>_ROOT}}, {{ENV\{<ParentPackage>_ROOT}}}, etc. {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)