cmake with OS libraries/binaries in non-standard location
Hi, We are running a system which, for various reasons that are irrelevant, have system libraries (libz, libX11, etc) and binaries (ls, git, etc) installed in a non-standard location.
We have tried configuring
- CMAKE_SYSTEM_PREFIX_PATH
- CMAKE_PREFIX_PATH
to point to this non-standard location, but we always run into various problems.
In case 1), cmake often does not look into this path to find libraries that are actually there. For example, it don't find libz there.
In case 2), it's the opposite that happens, cmake will look there first. This has the side-effect that if we have a "gcc" in the $PATH that is different than the one in $CMAKE_PREFIX_PATH, it will use the one in $CMAKE_PREFIX_PATH by default.
Is there something we can do that would
- Ensure that libraries in the non-standard location are found
- Ensure that if there is something found in $PATH or $LIBRARY_PATH, those will have priority ?
We've tried with an old cmake (version 3.8.2) and a brand-new one (version 3.12.3), but we're always having similar problems.
Thanks for the advice.