-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
From #3469 (comment)
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
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>_ROOTCMake variable and the<PackageName>_ROOTenvironment 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.
Reporter: Kouhei Sutou / @kou
Assignee: Uwe Korn / @xhochy
Subtasks:
Related issues:
- [C++] Rework CMake third-party logic (is a child of)
- [C++] Please have a cmake variable to build with all externally installed dependency packages (relates to)
Note: This issue was originally created as ARROW-4383. Please see the migration documentation for further details.