Issue
Despite reading the documentation I can't figure out whether CMake's command find_library
searches or not the directories listed in LD_LIBRARY_PATH
.
My tests give mixed results.
Solution
From the documentation (I didn't reproduced the text related to cmake variables nor parameters of find_library
, which are not relevant here):
If
NO_DEFAULT_PATH
is specified, then no additional paths are added to the search. IfNO_DEFAULT_PATH
is not specified, the search process is as follows:...
- Search the standard system environment variables. This can be skipped if
NO_SYSTEM_ENVIRONMENT_PATH
is an argument.
- Directories in
LIB
. On Windows hosts:<prefix>/lib/<arch>
ifCMAKE_LIBRARY_ARCHITECTURE
is set, and<prefix>/lib
for each<prefix>/[s]bin
inPATH
, and<entry>/lib
for other entries inPATH
, and the directories inPATH
itself....
So LD_LIBRARY_PATH
is not used by find_library
. This is confirmed reading the source code.
The mixed results of your tests may come from an other variable, but without a detailed description of these tests, this is just a guess.
Answered By - rgmt Answer Checked By - Cary Denson (WPSolving Admin)